[issue2576] httplib read() very slow due to lack of socket buffer

Daniel Diniz report at bugs.python.org
Wed Apr 9 05:48:48 CEST 2008


Daniel Diniz <ajaksu at gmail.com> added the comment:

"The code patch is trivial", he said, only to find out it was not :)

Facundo, thanks in advance for taking a look at this!

This patch tries to implement, document and test an optional argument to
HTTPConnection, which passes it to HTTPResponse. So far, it's called
"sockbuf", but I truly hope we can find a better name.

The crux of the test is that it shouldn't be possible to use a buffered
socket and a persistent connection simultaneously, as that was the
reason a buffer was left out (see issue 508157). It also tries to check
correctly allowing Keep-Alive when sockbuf==0. However, it fails to
exercise HTTPResponse properly and needs a review down the
auto-reconnect path. Persistent connections should be tested.

Regarding the code, there's a chance that some changes touching forced
closing are bogus (but not harmful). I'll get back to it and to
persistent connection tests.

Thanks again :)

Added file: http://bugs.python.org/file9990/buffered_socket.diff

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue2576>
__________________________________


More information about the Python-bugs-list mailing list