Skip to content

Commit

Permalink
Make sure we can pass the connection pool into the client.
Browse files Browse the repository at this point in the history
  • Loading branch information
dreid committed Jan 23, 2013
1 parent 06053e4 commit a29f5c2
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions treq/client.py
Expand Up @@ -71,11 +71,12 @@ def with_config(cls, **kwargs):
if not reactor:
from twisted.internet import reactor

agent = Agent(
reactor,
pool=HTTPConnectionPool(
reactor,
persistent=kwargs.get('persistent', True)))
pool = kwargs.get('pool')
if not pool:
persistent = kwargs.get('persistent', True)
pool = HTTPConnectionPool(reactor, persitent=persistent)

agent = Agent(reactor, pool=pool)

if kwargs.get('allow_redirects', True):
agent = RedirectAgent(agent)
Expand Down

0 comments on commit a29f5c2

Please sign in to comment.