From: Senthil Kumaran Date: Mon, 23 Apr 2012 15:46:46 +0000 (+0800) Subject: Fix for Issue13684 - httplib tunnel infinite loop X-Git-Tag: v2.7.4rc1~889^2~4 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0267185088e407144cf3d20f8e6b346e5d109e75;p=thirdparty%2FPython%2Fcpython.git Fix for Issue13684 - httplib tunnel infinite loop --- diff --git a/Lib/httplib.py b/Lib/httplib.py index 13629c4a965a..5d16e53c4c39 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):