Re: http header deletion?

From: Robert Collins <robertc@dont-contact.us>
Date: Tue, 11 Dec 2007 14:49:49 +1100

On Mon, 2007-12-10 at 17:26 +0900, Adrian Chadd wrote:
>
> Why/where is the code assuming that offset 0 will be HDR_DATE and
> offset 1 will
> be HDR_EXPIRES? The replacement code doesn't check to see whether
> anything is
> at the position in the array that its inserting into..
>
> Would it make more sense to modify httpHeaderDelById() to return the
> first offset
> it found a header of that type at and then make httpHeaderInsertTime()
> use that?
> Or perhaps replace that with a httpHeaderReplaceEntry() to replace an
> entry at
> that position? httpHeaderInsertEntry() is only used by
> httpHeaderInsertTime();
> httpHeaderInsertTime() is only ever called in the above snippet of
> code.

I haven't checked the code yet but 'insert' suggests to me that it
inserts and shifts everthing down, as Amos says - inserting at 0 makes
sense when adding both an expires and date header.

-Rob

-- 
GPG key available at: <http://www.robertcollins.net/keys.txt>.

Received on Mon Dec 10 2007 - 21:05:50 MST

This archive was generated by hypermail pre-2.1.9 : Mon Dec 31 2007 - 12:00:03 MST