From 67f50a0fe53765987e5a6a1c02daabe6400322af Mon Sep 17 00:00:00 2001 From: Chris Adams Date: Sun, 29 Jan 2012 18:45:14 -0500 Subject: [PATCH] Less redundant freeing of resources on redirects With 495646bb6a89802a60208c2ab09749edba1f8e51 the double flush is no longer needed. --- requests/models.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/requests/models.py b/requests/models.py index b4118b93..0647814f 100644 --- a/requests/models.py +++ b/requests/models.py @@ -210,6 +210,8 @@ class Request(object): while (('location' in r.headers) and ((r.status_code is codes.see_other) or (self.allow_redirects))): + r.content # Consume socket so it can be released + if not len(history) < self.config.get('max_redirects'): raise TooManyRedirects()