From 63723b10d7cde0c386880e83f4298ffd4dece077 Mon Sep 17 00:00:00 2001 From: Patrick Cloke Date: Wed, 24 May 2023 15:18:02 -0400 Subject: Ensure persistent connections are always used. --- synapse/http/client.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/synapse/http/client.py b/synapse/http/client.py index ef27dab85e..685d360f5c 100644 --- a/synapse/http/client.py +++ b/synapse/http/client.py @@ -784,6 +784,13 @@ class SimpleHttpClient(BaseHttpClient): self.reactor, self._ip_allowlist, self._ip_blocklist ) + # If no connection pool was given, create a default one. + # + # This differs from _AgentBase.__init__ by creating a HTTPConnectionPool + # which uses persistent connections. + if connection_pool is None: + connection_pool = HTTPConnectionPool(self.reactor) + self.agent: IAgent = ProxyAgent( self.reactor, hs.get_reactor(), -- cgit 1.5.1