From 291e942332e06cf1aa14f2e608dee0e50deed8ff Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Thu, 28 May 2015 15:34:00 +0100 Subject: [PATCH] Use connection pool for federation connections --- synapse/http/matrixfederationclient.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/synapse/http/matrixfederationclient.py b/synapse/http/matrixfederationclient.py index 6f976d5ce..9b6ba2d54 100644 --- a/synapse/http/matrixfederationclient.py +++ b/synapse/http/matrixfederationclient.py @@ -16,7 +16,7 @@ from twisted.internet import defer, reactor, protocol from twisted.internet.error import DNSLookupError -from twisted.web.client import readBody, _AgentBase, _URI +from twisted.web.client import readBody, _AgentBase, _URI, HTTPConnectionPool from twisted.web.http_headers import Headers from twisted.web._newclient import ResponseDone @@ -103,7 +103,8 @@ class MatrixFederationHttpClient(object): self.hs = hs self.signing_key = hs.config.signing_key[0] self.server_name = hs.hostname - self.agent = MatrixFederationHttpAgent(reactor) + pool = HTTPConnectionPool(reactor) + self.agent = MatrixFederationHttpAgent(reactor, pool) self.clock = hs.get_clock() self.version_string = hs.version_string