summaryrefslogtreecommitdiff
path: root/src/leap/soledad/__init__.py
diff options
context:
space:
mode:
authorTomás Touceda <chiiph@leap.se>2013-06-11 10:32:13 -0300
committerTomás Touceda <chiiph@leap.se>2013-06-11 10:32:13 -0300
commit7a737ff200c63e7d3a2dc5619b619e07b56fc6a2 (patch)
tree176e7056c95675ede38d6d9dce6c085777bb700b /src/leap/soledad/__init__.py
parent194ff4c40047462e112737a74968ec21a75bfba7 (diff)
Make request timeouts modifiable
Diffstat (limited to 'src/leap/soledad/__init__.py')
-rw-r--r--src/leap/soledad/__init__.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/leap/soledad/__init__.py b/src/leap/soledad/__init__.py
index ea3f676b..21457caf 100644
--- a/src/leap/soledad/__init__.py
+++ b/src/leap/soledad/__init__.py
@@ -1073,6 +1073,9 @@ class Soledad(object):
# Monkey patching u1db to be able to provide a custom SSL cert
#-----------------------------------------------------------------------------
+# We need a more reasonable timeout (in seconds)
+SOLEDAD_TIMEOUT = 10
+
class VerifiedHTTPSConnection(httplib.HTTPSConnection):
"""HTTPSConnection verifying server side certificates."""
# derived from httplib.py
@@ -1080,7 +1083,7 @@ class VerifiedHTTPSConnection(httplib.HTTPSConnection):
def connect(self):
"Connect to a host on a given (SSL) port."
sock = socket.create_connection((self.host, self.port),
- self.timeout, self.source_address)
+ SOLEDAD_TIMEOUT, self.source_address)
if self._tunnel_host:
self.sock = sock
self._tunnel()