projects
/
services
/
python-requests.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e695941
)
Release redirected connections.
author
Kenneth Reitz
<me@kennethreitz.com>
Sun, 29 Jan 2012 23:00:33 +0000
(18:00 -0500)
committer
Kenneth Reitz
<me@kennethreitz.com>
Sun, 29 Jan 2012 23:00:33 +0000
(18:00 -0500)
#239
requests/models.py
patch
|
blob
|
history
diff --git
a/requests/models.py
b/requests/models.py
index
c2cbe97
..
5737dd9
100644
(file)
--- a/
requests/models.py
+++ b/
requests/models.py
@@
-216,6
+216,9
@@
class Request(object):
if not len(history) < self.config.get('max_redirects'):
raise TooManyRedirects()
+ # Release the connection back into the pool.
+ r.raw.release_conn()
+
history.append(r)
url = r.headers['location']
@@
-504,7
+507,7
@@
class Request(object):
# Attach Cookie header to request.
self.headers['Cookie'] = cookie_header
-
+
# Pre-request hook.
r = dispatch_hook('pre_request', self.hooks, self)
self.__dict__.update(r.__dict__)