mirror of
https://mau.dev/maunium/synapse.git
synced 2024-12-16 16:33:51 +01:00
Fix bug in timeout handling in keyclient
This commit is contained in:
parent
c1d860870b
commit
823999716e
1 changed files with 4 additions and 3 deletions
|
@ -61,9 +61,11 @@ class SynapseKeyClientProtocol(HTTPClient):
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.remote_key = defer.Deferred()
|
self.remote_key = defer.Deferred()
|
||||||
|
self.host = None
|
||||||
|
|
||||||
def connectionMade(self):
|
def connectionMade(self):
|
||||||
logger.debug("Connected to %s", self.transport.getHost())
|
self.host = self.transport.getHost()
|
||||||
|
logger.debug("Connected to %s", self.host)
|
||||||
self.sendCommand(b"GET", b"/_matrix/key/v1/")
|
self.sendCommand(b"GET", b"/_matrix/key/v1/")
|
||||||
self.endHeaders()
|
self.endHeaders()
|
||||||
self.timer = reactor.callLater(
|
self.timer = reactor.callLater(
|
||||||
|
@ -92,8 +94,7 @@ class SynapseKeyClientProtocol(HTTPClient):
|
||||||
self.timer.cancel()
|
self.timer.cancel()
|
||||||
|
|
||||||
def on_timeout(self):
|
def on_timeout(self):
|
||||||
logger.debug("Timeout waiting for response from %s",
|
logger.debug("Timeout waiting for response from %s", self.host)
|
||||||
self.transport.getHost())
|
|
||||||
self.remote_key.errback(IOError("Timeout waiting for response"))
|
self.remote_key.errback(IOError("Timeout waiting for response"))
|
||||||
self.transport.abortConnection()
|
self.transport.abortConnection()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue