From 3a30846bd088bbfecd9ddfa1ee82a6951670ade7 Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Thu, 11 Apr 2024 16:03:45 +0100 Subject: Fix mypy on latest Twisted release (#17036) `ITransport.abortConnection` isn't a thing, but `HTTPChannel.forceAbortClient` calls it, so lets just use that Fixes https://github.com/element-hq/synapse/issues/16728 --- synapse/http/proxy.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'synapse/http/proxy.py') diff --git a/synapse/http/proxy.py b/synapse/http/proxy.py index 6cbbd5741b..5b5ded757b 100644 --- a/synapse/http/proxy.py +++ b/synapse/http/proxy.py @@ -262,7 +262,8 @@ class _ProxyResponseBody(protocol.Protocol): self._request.finish() else: # Abort the underlying request since our remote request also failed. - self._request.transport.abortConnection() + if self._request.channel: + self._request.channel.forceAbortClient() class ProxySite(Site): -- cgit 1.5.1