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