Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for HTTPConnection.getresponse(buffering=True) #66

Closed
pkwarren opened this issue Apr 2, 2012 · 1 comment
Closed

Add support for HTTPConnection.getresponse(buffering=True) #66

pkwarren opened this issue Apr 2, 2012 · 1 comment

Comments

@pkwarren
Copy link

pkwarren commented Apr 2, 2012

Python 2.7 has added support for buffering when reading from HTTP connections, which leads to a significant improvement in HTTP client performance.

See: http://bugs.python.org/issue4879

It looks like the only changes required would be in HTTPConnectionPool._make_request, passing buffering=True to the getresponse() call on Python 2.7 and later.

urllib2.py does the following:

try:
    r = h.getresponse(buffering=True)
except TypeError: #buffering kw not supported
    r = h.getresponse()
@shazow
Copy link
Member

shazow commented Apr 2, 2012

Hmm interesting. As far as I understand this, it should only impact reading the headers, correct?

I'm happy to accept a patch for this if you'd like to send a pull request. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants