mirror of
https://github.com/python/cpython.git
synced 2025-11-25 04:34:37 +00:00
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:
parent
5f135787ec
commit
9298eff5f9
3 changed files with 7 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue