[MERGE][ping] Better connection sharing for pycurl

Vincent Ladeuil v.ladeuil at alplog.fr
Wed Oct 25 08:04:27 BST 2006


>>>>> "jam" == John Arbash Meinel <john at arbash-meinel.com> writes:

    jam> Vincent Ladeuil wrote:
    >> By specifying explicitly the 'Range' header, we avoid the need to
    >> use two different curl objects (and two connections to the same
    >> server).
    >> 
    >> This has already got a +1 from John. Seeking a second one for
    >> inclusion.
    >> 
    >> Vincent
    >> 
    >> 
    >> 
    jam> ...

    jam> I think it looks good. But I do have one question about why you only
    jam> override 'Expect: ' for POST, whereas bzr was currently overriding it
    jam> for all requests.

Merge side effect. It comes from Andrew adding a post request
with a comment :

        # We override the Expect: header so that pycurl will send
        # the POST body immediately.

It may not be obvious in my patch because Andrew was doing it at
the point where all common headers were added (i.e. GET requests
too, inherit from that header), which was the simplest and
logical thing to do in *his* context.

But I had changed that part of the code by adding a
'more_headers' to the _perform method allowing requests to
specify their own headers (think 'Range'), so moving that to
_post was the simplest and logical thing to do in this context :)

      Vincent




More information about the bazaar mailing list