GNOME Bugzilla – Bug 602863
Bug in nginx causing libsoup to ignore responces
Last modified: 2009-12-14 20:44:01 UTC
chat snip: (01:16:06 PM) avb1: danw: http://paste.pocoo.org/show/152647/ (01:17:31 PM) danw: it looks like the server is putting a "\n" before the response... (01:18:48 PM) danw: or else, assuming that connection was used previously, it put an extra "\n" after the previous response, or else libsoup mis-parsed the previous response and read one byte too few .... (02:42:47 PM) danw: avb1: so yeah, packet 431 has an excess trailing \n, and then the next request on that socket is the bad one for /v2/style.css .... (02:49:45 PM) danw: we strip out excess CRs/LFs before a request in the server-side parsing (because the spec explicitly recommends that because of certain buggy old clients). we could do the same before the response in client-side parsing
Created attachment 148868 [details] [review] quick fix Fix is not accurate, but tested and works for sure. If you will suggest me a correct place to look for ill prepare new patch
Comment on attachment 148868 [details] [review] quick fix You need to skip '\r' too. Look at the beginning of soup_headers_parse_request(), you can just copy that. Also, you want to do this from soup_headers_parse_response(), before the call to soup_headers_parse(), not from soup_headers_parse_status_line(). Also, you should add a test to tests/header-parsing.c (to the "recoverable responses" section of resptests) to make sure we don't break this functionality in the future.
Created attachment 148972 [details] [review] updated fix i was so close :)
Created attachment 148973 [details] [review] patch with test
ping? Patch looks very simple. Probably it can be commited and backported to a future 2.28.2 release? Issue looks really weird.
fixed in git, will go into 2.28.2 later this week