diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2008-02-12 18:47:34 (GMT) |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2008-02-12 18:47:34 (GMT) |
commit | dad88dc15909843f1a9caf3edd9d0fb61f1ee0e4 (patch) | |
tree | de4dd35b6e9d967e935a12c81cb55194b7a6f459 /Lib/httplib.py | |
parent | 8d365c323ffdaf98694671d82fb1d4d7af41eaf8 (diff) | |
download | cpython-dad88dc15909843f1a9caf3edd9d0fb61f1ee0e4.zip cpython-dad88dc15909843f1a9caf3edd9d0fb61f1ee0e4.tar.gz cpython-dad88dc15909843f1a9caf3edd9d0fb61f1ee0e4.tar.bz2 |
Patch #1966: Break infinite loop in httplib when the servers
implements the chunked encoding incorrectly.
Will backport to 2.5.
Diffstat (limited to 'Lib/httplib.py')
-rw-r--r-- | Lib/httplib.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/httplib.py b/Lib/httplib.py index d4ea268..6d27d24 100644 --- a/Lib/httplib.py +++ b/Lib/httplib.py @@ -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 |