Ensure persistent connections are always used.

This commit is contained in:
Patrick Cloke 2023-05-24 15:18:02 -04:00
parent b14f5f1fb5
commit 63723b10d7
1 changed files with 7 additions and 0 deletions

View File

@ -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(),