This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author cjw296
Recipients ajaksu2, cjw296, facundobatista, reacocard, schmir
Date 2009-08-12.07:54:21
SpamBayes Score 0.00121993
Marked as misclassified No
Message-id <>
I tried to use the following to change the buffersize for a download:

from base64 import encodestring
from httplib import HTTPResponse,HTTPConnection,HTTPSConnection,_UNKNOWN
from datetime import datetime

class FHTTPResponse(HTTPResponse):

    def __init__(self, sock, debuglevel=0, strict=0, method=None):
        print "creating response"
        self.fp = sock.makefile('rb',4096)
        self.debuglevel = debuglevel
        self.strict = strict
        self._method = method

        self.msg = None

        # from the Status-Line of the response
        self.version = _UNKNOWN # HTTP-Version
        self.status = _UNKNOWN  # Status-Code
        self.reason = _UNKNOWN  # Reason-Phrase

        self.chunked = _UNKNOWN         # is "chunked" being used?
        self.chunk_left = _UNKNOWN      # bytes left to read in current 
        self.length = _UNKNOWN          # number of bytes left in 
        self.will_close = _UNKNOWN      # conn will close at end of 
class FHTTPConnection(HTTPConnection):
    response_class = FHTTPResponse

class FHTTPSConnection(HTTPSConnection):
    response_class = FHTTPResponse

conn = FHTTPSConnection('localhost')
headers = {}
auth = 'Basic '+encodestring('usernmae:password').strip()
t =
print t
print 'request:',
response = conn.getresponse()
print 'response:',
data =
print 'read:',

..however, I saw absolutely no change in download speed.

Aren, I notice in your pastebin code that you do 
in a loop rather than just one, why is that?
Date User Action Args
2009-08-12 07:54:24cjw296setrecipients: + cjw296, facundobatista, ajaksu2, schmir, reacocard
2009-08-12 07:54:24cjw296setmessageid: <>
2009-08-12 07:54:23cjw296linkissue2576 messages
2009-08-12 07:54:21cjw296create