Message173505
| Author |
eranrund |
| Recipients |
eranrund |
| Date |
2012年10月22日.11:32:31 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1350905552.38.0.183421910215.issue16298@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
When calling HTTPResponse.read() on a response that is:
a. not chunked
b. contains no content-length header
the underlying socket (referenced by self.fp) will never get closed (through self.close())
The offending code is at the bottom of the read() function:
s = self.fp.read(amt)
if self.length is not None:
self.length -= len(s)
if not self.length:
self.close()
return s
As seen, if self.length is None, even when the server closes the connection (causing self.fp.read to return ''), the socket will not get closed.
btw, this may be the cause of Issue15633 (http://bugs.python.org/issue15633) |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2012年10月22日 11:32:32 | eranrund | set | recipients:
+ eranrund |
| 2012年10月22日 11:32:32 | eranrund | set | messageid: <1350905552.38.0.183421910215.issue16298@psf.upfronthosting.co.za> |
| 2012年10月22日 11:32:32 | eranrund | link | issue16298 messages |
| 2012年10月22日 11:32:31 | eranrund | create |
|