summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordrebs <drebs@leap.se>2013-06-13 12:11:29 -0300
committerdrebs <drebs@leap.se>2013-06-13 12:11:29 -0300
commit0deaa2070a88404779ae9a8dab88ee11521c5032 (patch)
tree571c09145e1a9baf649bee6b1a0856a868580ccf
parent92724a1bf110a6f97dbfaec4a7d68388eef19dc5 (diff)
parent7a737ff200c63e7d3a2dc5619b619e07b56fc6a2 (diff)
Merge remote-tracking branch 'remotes/chiiph/bug/modifiable_timeout' into develop
-rw-r--r--changes/bug_modifiable_timeout3
-rw-r--r--src/leap/soledad/__init__.py5
2 files changed, 7 insertions, 1 deletions
diff --git a/changes/bug_modifiable_timeout b/changes/bug_modifiable_timeout
new file mode 100644
index 00000000..be690d5a
--- /dev/null
+++ b/changes/bug_modifiable_timeout
@@ -0,0 +1,3 @@
+ o Database request have default timeout too high, a
+ soledad.SOLEDAD_TIMEOUT variable has been added in order to have
+ more control over this. Fixes #2713 \ No newline at end of file
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()