From cff3b7f9bd96b6837914ebb0fcf79ba874569ca5 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Sun, 25 Sep 2011 22:59:20 -0400 Subject: [PATCH] urllib3 update --- requests/packages/urllib3/connectionpool.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/requests/packages/urllib3/connectionpool.py b/requests/packages/urllib3/connectionpool.py index 95e3dd4a..add6fbc7 100644 --- a/requests/packages/urllib3/connectionpool.py +++ b/requests/packages/urllib3/connectionpool.py @@ -284,6 +284,7 @@ class HTTPConnectionPool(ConnectionPool): httplib_response = self._make_request(conn, method, url, timeout=timeout, body=body, headers=headers) + # Import httplib's response into our own wrapper object response = HTTPResponse.from_httplib(httplib_response, pool=self, @@ -309,7 +310,8 @@ class HTTPConnectionPool(ConnectionPool): finally: if release_conn: # Put the connection back to be reused - self._put_conn(conn) + response.release_conn() # Equivalent to self._put_conn(conn) but + # tracks release state. if not conn: log.warn("Retrying (%d attempts remain) after connection "