Rewrite this to be easier to understand and more correct, and make the
authorDan Winship <danw@src.gnome.org>
Sat, 6 Jan 2007 19:24:44 +0000 (19:24 +0000)
committerDan Winship <danw@src.gnome.org>
Sat, 6 Jan 2007 19:24:44 +0000 (19:24 +0000)
commit536d7139dedeb86cfe19fe1b5de4ab240aae0c06
tree0fc95d9c0b7a8f8f02ea4ab25c2f4771eb69bcfe
parented822899a0a752fea5eb44f2f4ea4eaaed9d1176
Rewrite this to be easier to understand and more correct, and make the

* libsoup/soup-headers.c (soup_headers_parse): Rewrite this to be
easier to understand and more correct, and make the "str" param
const rather than overwriting it during parsing.
(soup_headers_parse_request, soup_headers_parse_response):
Likewise, make "str" param const. Fix the doc comment to describe
the correct constraint on str. Make the parsing slightly more
lenient as per sections 4.1 and 19.3 of RFC 2616.

* tests/header-parsing.c: new regression test, for Request-Line,
Status-Line, and message-header parsing.

Inspired by #391970 (crash in SoupServer when certain invalid
requests are received).

svn path=/trunk/; revision=905
ChangeLog
libsoup/soup-headers.c
libsoup/soup-headers.h
tests/Makefile.am
tests/header-parsing.c [new file with mode: 0644]