mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
Issue #16037: Limit httplib's _read_status() function to work around broken
HTTP servers and reduce memory usage. It's actually a backport of a Python 3.2 fix. Thanks to Adrien Kunysz.
This commit is contained in:
parent
d41dc7ce46
commit
671138f27d
2 changed files with 7 additions and 1 deletions
|
@ -362,7 +362,9 @@ class HTTPResponse:
|
||||||
|
|
||||||
def _read_status(self):
|
def _read_status(self):
|
||||||
# Initialize with Simple-Response defaults
|
# Initialize with Simple-Response defaults
|
||||||
line = self.fp.readline()
|
line = self.fp.readline(_MAXLINE + 1)
|
||||||
|
if len(line) > _MAXLINE:
|
||||||
|
raise LineTooLong("header line")
|
||||||
if self.debuglevel > 0:
|
if self.debuglevel > 0:
|
||||||
print "reply:", repr(line)
|
print "reply:", repr(line)
|
||||||
if not line:
|
if not line:
|
||||||
|
|
|
@ -9,6 +9,10 @@ What's New in Python 2.7.4
|
||||||
Core and Builtins
|
Core and Builtins
|
||||||
-----------------
|
-----------------
|
||||||
|
|
||||||
|
- Issue #16037: Limit httplib's _read_status() function to work around broken
|
||||||
|
HTTP servers and reduce memory usage. It's actually a backport of a Python
|
||||||
|
3.2 fix. Thanks to Adrien Kunysz.
|
||||||
|
|
||||||
- Issue #13992: The trashcan mechanism is now thread-safe. This eliminates
|
- Issue #13992: The trashcan mechanism is now thread-safe. This eliminates
|
||||||
sporadic crashes in multi-thread programs when several long deallocator
|
sporadic crashes in multi-thread programs when several long deallocator
|
||||||
chains ran concurrently and involved subclasses of built-in container
|
chains ran concurrently and involved subclasses of built-in container
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue