3.2 - Fix for Issue13684 - httplib tunnel infinite loop

This commit is contained in:
Senthil Kumaran 2012-04-23 23:53:51 +08:00
commit aa872d1690
1 changed files with 3 additions and 0 deletions

View File

@ -786,6 +786,9 @@ def _tunnel(self):
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