summary refs log tree commit diff
path: root/synapse/http/endpoint.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2016-12-29 00:10:49 +0000
committerErik Johnston <erik@matrix.org>2016-12-29 00:10:49 +0000
commit68030fd37bcae8e1dd3deea971b7f13461e0ef72 (patch)
treebe976b773a7cc258a776c141660452acdebe9f9b /synapse/http/endpoint.py
parentClean up (diff)
downloadsynapse-68030fd37bcae8e1dd3deea971b7f13461e0ef72.tar.xz
Spelling and comments
Diffstat (limited to 'synapse/http/endpoint.py')
-rw-r--r--synapse/http/endpoint.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/synapse/http/endpoint.py b/synapse/http/endpoint.py
index 4d361bbe73..95424481ca 100644
--- a/synapse/http/endpoint.py
+++ b/synapse/http/endpoint.py
@@ -66,18 +66,18 @@ def matrix_federation_endpoint(reactor, destination, ssl_context_factory=None,
         default_port = 8448
 
     if port is None:
-        return _WrappingEndointFac(SRVClientEndpoint(
+        return _WrappingEndpointFac(SRVClientEndpoint(
             reactor, "matrix", domain, protocol="tcp",
             default_port=default_port, endpoint=transport_endpoint,
             endpoint_kw_args=endpoint_kw_args
         ))
     else:
-        return _WrappingEndointFac(transport_endpoint(
+        return _WrappingEndpointFac(transport_endpoint(
             reactor, domain, port, **endpoint_kw_args
         ))
 
 
-class _WrappingEndointFac(object):
+class _WrappingEndpointFac(object):
     def __init__(self, endpoint_fac):
         self.endpoint_fac = endpoint_fac
 
@@ -105,7 +105,9 @@ class _WrappedConnection(object):
         setattr(self.conn, name, value)
 
     def _time_things_out_maybe(self):
-        if time.time() - self.last_request >= 2 * 60:
+        # We use a slightly shorter timeout here just in case the callLater is
+        # triggered early. Paranoia ftw.
+        if time.time() - self.last_request >= 2.5 * 60:
             self.abort()
 
     def request(self, request):