[MERGE][ping] Better connection sharing for pycurl
Andrew Bennetts
andrew at canonical.com
Wed Oct 25 09:17:21 BST 2006
Vincent Ladeuil wrote:
> >>>>> "jam" == John Arbash Meinel <john at arbash-meinel.com> writes:
[...]
> 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 :)
Just to second this, changing it to only happen for POSTs is fine with me. I
didn't do that originally just out of laziness/simplicity. If it's now as
simple to only do it for POSTs, then that's fine.
(Disabling the Expect header means that pycurl doesn't wait for 1 second when
POSTing, which is an obvious performance issue. See the RFC or talk to Robert
if you're curious about this piece of HTTP/1.1 esoterica.)
-Andrew.
More information about the bazaar
mailing list