cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Order of appearance of header settings

From: Daniel Stenberg <daniel-curl_at_haxx.se>
Date: Tue, 11 Oct 2005 13:11:21 +0200 (CEST)

On Tue, 11 Oct 2005, Roberto Nibali wrote:

>> 2) The ordering is quite simply sent in the order of the code flow.
>
> So what's the order of the internal headers?

You could look through the 100+ test cases for HTTP to get a good idea. See
the files named tests/data/test*. But the order is not carved in stone, if
solving a problem in a nice way involves changing header order, then I prefer
nice code before enforcing preserved header order.

> Also might it be possible that if you don't overwrite an internal header
> that it is not even sent?

Then that's a bug. Internally generated headers are either disabled or
replaced. If you don't overwrite an internal header it should be included in
the request.

>> it will always send those headers in the same fixed order with no regard in
>> what order you set them in.
>
> I would like to document this.

Feel free to suggest a patch or just what wording that should go where in the
docs. I love having accurate and detailed docs, but I need help to make it and
keep it so.

> However the order of appearance of those header options was not apparent to
> me from glancing over your code in 10 minutes ;).

No, the code is not really written to make that situation crystal clear. And
that's why I recommend checking out the test case files, as they show exactly
what libcurl actually sends (in different situations).

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
Received on 2005-10-11