summaryrefslogtreecommitdiffstats
path: root/Lib/httplib.py
diff options
context:
space:
mode:
authorSenthil Kumaran <senthil@uthcode.com>2012-04-23 15:46:46 (GMT)
committerSenthil Kumaran <senthil@uthcode.com>2012-04-23 15:46:46 (GMT)
commit0267185088e407144cf3d20f8e6b346e5d109e75 (patch)
tree2d557a5af482827b267ce0a388ec76fb039ce125 /Lib/httplib.py
parenteda1959d076caaa13a84fc6846b6acd017921ca4 (diff)
downloadcpython-0267185088e407144cf3d20f8e6b346e5d109e75.zip
cpython-0267185088e407144cf3d20f8e6b346e5d109e75.tar.gz
cpython-0267185088e407144cf3d20f8e6b346e5d109e75.tar.bz2
Fix for Issue13684 - httplib tunnel infinite loop
Diffstat (limited to 'Lib/httplib.py')
-rw-r--r--Lib/httplib.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/httplib.py b/Lib/httplib.py
index 13629c4..5d16e53 100644
--- a/Lib/httplib.py
+++ b/Lib/httplib.py
@@ -748,7 +748,11 @@ class HTTPConnection:
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):