Bug #978833: Really close underlying socket in _socketobject.close.

Fix httplib.HTTPConnection.getresponse to not close the
socket if it is still needed for the response.
This commit is contained in:
Martin v. Löwis 2006-07-26 12:12:56 +00:00
parent 5f135787ec
commit 9298eff5f9
3 changed files with 7 additions and 2 deletions

View file

@ -926,8 +926,8 @@ class HTTPConnection:
self.__state = _CS_IDLE
if response.will_close:
# this effectively passes the connection to the response
self.close()
# Pass the socket to the response
self.sock = None
else:
# remember this, so we can tell when it is complete
self.__response = response