Patch #1966: Break infinite loop in httplib when the servers

implements the chunked encoding incorrectly.
Will backport to 2.5.
This commit is contained in:
Martin v. Löwis 2008-02-12 18:47:34 +00:00
parent 8d365c323f
commit dad88dc159
2 changed files with 7 additions and 0 deletions

View file

@ -573,6 +573,10 @@ class HTTPResponse:
### note: we shouldn't have any trailers!
while True:
line = self.fp.readline()
if not line:
# a vanishingly small number of sites EOF without
# sending the trailer
break
if line == '\r\n':
break