diff options
author | drebs <drebs@riseup.net> | 2017-09-02 02:38:57 -0300 |
---|---|---|
committer | drebs <drebs@riseup.net> | 2017-09-05 11:17:51 -0300 |
commit | e8cc3ca3d4ea868a971ae2479333a4e1807cf8be (patch) | |
tree | dfa9b526e6ee70c03c1940ba6f21c366aa8dfcaf /src | |
parent | 303a0cb452c4d252e0204449dd847dabc210e89b (diff) |
[feat] use a persistent connetion pool in http agent
Diffstat (limited to 'src')
-rw-r--r-- | src/leap/soledad/client/_http.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/leap/soledad/client/_http.py b/src/leap/soledad/client/_http.py index 101c61be..f6e2e28e 100644 --- a/src/leap/soledad/client/_http.py +++ b/src/leap/soledad/client/_http.py @@ -23,6 +23,7 @@ from twisted.internet import reactor from twisted.web.iweb import IAgent from twisted.web.client import Agent from twisted.web.client import CookieAgent +from twisted.web.client import HTTPConnectionPool from twisted.web.http_headers import Headers from cookielib import CookieJar @@ -57,7 +58,8 @@ class PinnedTokenAgent(Agent): self.set_token(token) # pin this agent with the platform TLS certificate factory = getPolicyForHTTPS(cert_file) - Agent.__init__(self, reactor, contextFactory=factory) + pool = HTTPConnectionPool(reactor, persistent=True) + Agent.__init__(self, reactor, contextFactory=factory, pool=pool) def set_token(self, token): self._token = token |