diff options
author | Gregory P. Smith <greg@mad-scientist.com> | 2009-08-19 05:33:48 (GMT) |
---|---|---|
committer | Gregory P. Smith <greg@mad-scientist.com> | 2009-08-19 05:33:48 (GMT) |
commit | e2ae86a19ea95642eb7d5513506474f403304808 (patch) | |
tree | 92a36c828193f8b71e3765dd6758f9abea4c9911 | |
parent | 6f1fa214c500100f5ee43463f33c11596319c437 (diff) | |
download | cpython-e2ae86a19ea95642eb7d5513506474f403304808.zip cpython-e2ae86a19ea95642eb7d5513506474f403304808.tar.gz cpython-e2ae86a19ea95642eb7d5513506474f403304808.tar.bz2 |
Revert the changes from r74463, they were causing test_xmlrpc to fail.
We do not need to force a close when using socket buffering on a
httplib.HTTPRequest as the library does not support streaming requests
so there should never been extra data beyond the end of the current
request to have left over in the requests socket buffer.
see http://bugs.python.org/issue6724
-rw-r--r-- | Lib/httplib.py | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/Lib/httplib.py b/Lib/httplib.py index 77be68c..149fcbc 100644 --- a/Lib/httplib.py +++ b/Lib/httplib.py @@ -328,12 +328,8 @@ class HTTPResponse: def __init__(self, sock, debuglevel=0, strict=0, method=None, buffering=False): if buffering: # The caller won't be using any sock.recv() calls, so buffering - # is fine and recommended for performance. + # is fine and recommendef for performance self.fp = sock.makefile('rb') - # As our sock.makefile() object may receive data into its buffer - # beyond that needed to satisfy this response, we must close - # afterwards. - self._must_close = True else: # The buffer size is specified as zero, because the headers of # the response are read with readline(). If the reads were @@ -341,7 +337,6 @@ class HTTPResponse: # response, which make be read via a recv() on the underlying # socket. self.fp = sock.makefile('rb', 0) - self._must_close = False self.debuglevel = debuglevel self.strict = strict self._method = method @@ -479,9 +474,6 @@ class HTTPResponse: self.will_close = 1 def _check_close(self): - if self._must_close: - return True - conn = self.msg.getheader('connection') if self.version == 11: # An HTTP/1.1 proxy is assumed to stay open unless |