Skip to contentSkip to conversation

conga/luci/site/luci/Extensions ricci_communic ...

Cluster-devel [email protected] 1 participant 1 message Sep 26, 2006

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/cluster
Module name: conga
Changes by: kupcevic at sourceware.org 2006-09-26 21:04:47

Modified files:
luci/site/luci/Extensions: ricci_communicator.py

Log message:
luci: set timeout on establishing connections to ricci (luci used to indefinitely block in connect() - preventing normal usage)

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/ricci_communicator.py.diff?cvsroot=cluster&r1=1.4&r2=1.5

luci/site/luci/Extensions/ricci_communicator.py +4 -0
@@ -23,8 +23,12 @@
         
         # socket
         sock = socket(AF_INET, SOCK_STREAM)
+        sock.settimeout(2.0)
         sock.connect((self.__hostname, self.__port))
         self.ss = ssl(sock, self.__privkey_file, self.__cert_file)
+        sock.settimeout(600.0) # 10 minutes
+        # TODO: data transfer timeout should be much less, 
+        # leave until all calls are async ricci calls
         
         # receive ricci header
         hello = self.__receive()