cURL / Mailing Lists / curl-users / Single Mail


Re: endless loop on redirect (with patch)

From: Daniel Stenberg <>
Date: Fri, 11 May 2001 09:54:39 +0200 (MET DST)

On Fri, 11 May 2001, Cris Bailiff wrote:

> > A good solution is probably to split up the comparisons from checking
> > strnequal(headerline, "header: content", length) as one string into a check
> > that splits the header and the content and checks them separately, like:
> > compareheader(headerline, "header", "content").
> Yes, this seems like a good solution.
> I might suggest a flag which can switch compareheader to 'strnindex'
> instead of 'strncmp' , because a number of headers can be multivalued,
> and you might need to search for a token.

When taking a closer look, I think the compareheader() function should always
search for the particular content.

A few strnequal()s are still left in the code for when only the header
keyword needs to match.

lib/transfer.c 1.40 was just committed with this fixed. I'm not convinced I
have enough test cases that excersise this stuff to be sure it works

> I noticed it in the code, and figured I'd wait for the problem to bite
> before worrying too much, but I notice that header variations were
> already noted/fixed with Sun Java Web server etc.

Yeah, but unfortunately, that kind of violations will be very hard to make
general work-arounds for.

> I guess when my toaster has a buggy web server in it, I won't be able to
> pop the toast with curl - back to good old SNMP...

Nah, then you rip out the code, reverse engineer the damned thing, fix it,
recompile and reflash the thing. Because "if it ain't done with curl, it
ain't worth doing" ;-P

Now, where's that ethernet plug on my toaster...

  Daniel Stenberg -- curl project maintainer --
Received on 2001-05-11