Issue #16298: In HTTPResponse.read(), close the socket when there is no Content-Length and the incoming stream is finished.

Patch by Eran Rundstein.
This commit is contained in:
Antoine Pitrou 2012-12-15 19:11:54 +01:00
parent eea058b014
commit 4113d2bd36
4 changed files with 23 additions and 1 deletions

View file

@ -565,6 +565,10 @@ class HTTPResponse:
self.length -= len(s)
if not self.length:
self.close()
else:
if not s:
self.close()
return s
def _read_chunked(self, amt):