Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 02 May 2011 16:58:41 +0200
From:      Robert Schulze <rs@bytecamp.net>
To:        freebsd-hackers@freebsd.org
Subject:   Re: [LIBC] Modfied Version of sscanf
Message-ID:  <4DBEC6A1.40302@bytecamp.net>
In-Reply-To: <BANLkTikTykeWDN3xR9dYJxWbhKGhmRPNTg@mail.gmail.com>
References:  <C9E46C77.389%moeller.akt@googlemail.com>	<4DBEAAD5.7040906@bytecamp.net>	<BANLkTim_WhRdWi8RbuubxQm4kD27V17h9g@mail.gmail.com>	<4DBEBC7A.60607@bytecamp.net> <BANLkTikTykeWDN3xR9dYJxWbhKGhmRPNTg@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi,

Am 02.05.2011 16:41, schrieb Artem Belevich:
>
>>         if(ptr&&  (ptr=strstr(ptr," HTTP/1.1"))) /* find end of res */
>
> Contrary to the comment in the code you're not checking for "HTTP/1.1"
> at the end but you're checking for it *anywhere* in the string. While
> it will occur at the end of valid input string, nobody said it can't
> occur in the middle, too. Original requirement was saying "surrounded
> by GET and HTTP/1.1".

good catch :-)
The additional test for end-of-string should be an exercise for the OP.
Reading the code of <your favourite webserver here> should clarify 
things, too.

With kind regards,
Robert Schulze




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4DBEC6A1.40302>