From: Senthil Kumaran Date: Mon, 23 Apr 2012 15:50:07 +0000 (+0800) Subject: 3.2 - Fix for Issue13684 - httplib tunnel infinite loop X-Git-Tag: v3.3.0a3~103^2~4 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b12771ab3048bb61b3dc09fd21198613f43fa030;p=python 3.2 - Fix for Issue13684 - httplib tunnel infinite loop --- diff --git a/Lib/http/client.py b/Lib/http/client.py index 745b999942..6828f146a7 100644 --- a/Lib/http/client.py +++ b/Lib/http/client.py @@ -715,6 +715,9 @@ class HTTPConnection: line = response.fp.readline(_MAXLINE + 1) if len(line) > _MAXLINE: raise LineTooLong("header line") + if not line: + # for sites which EOF without sending a trailer + break if line == b'\r\n': break