[Python-checkins] cpython (2.7): Fix for Issue13684 - httplib tunnel infinite loop
senthil.kumaran
python-checkins at python.org
Mon Apr 23 17:57:05 CEST 2012
http://hg.python.org/cpython/rev/790ae45b52be
changeset: 76490:790ae45b52be
branch: 2.7
parent: 76487:3c53edb86ee3
user: Senthil Kumaran <senthil at uthcode.com>
date: Mon Apr 23 23:46:46 2012 +0800
summary:
Fix for Issue13684 - httplib tunnel infinite loop
files:
Lib/httplib.py | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/Lib/httplib.py b/Lib/httplib.py
--- a/Lib/httplib.py
+++ b/Lib/httplib.py
@@ -748,7 +748,11 @@
line = response.fp.readline(_MAXLINE + 1)
if len(line) > _MAXLINE:
raise LineTooLong("header line")
- if line == '\r\n': break
+ if not line:
+ # for sites which EOF without sending trailer
+ break
+ if line == '\r\n':
+ break
def connect(self):
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list