After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 602863 - Bug in nginx causing libsoup to ignore responces
Bug in nginx causing libsoup to ignore responces
Status: RESOLVED FIXED
Product: libsoup
Classification: Core
Component: HTTP Transport
2.28.x
Other All
: Normal normal
: ---
Assigned To: libsoup-maint@gnome.bugs
libsoup-maint@gnome.bugs
Depends on:
Blocks:
 
 
Reported: 2009-11-24 19:10 UTC by Alexander V. Butenko
Modified: 2009-12-14 20:44 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
quick fix (498 bytes, patch)
2009-12-02 00:11 UTC, Alexander V. Butenko
needs-work Details | Review
updated fix (479 bytes, patch)
2009-12-02 23:06 UTC, Alexander V. Butenko
none Details | Review
patch with test (918 bytes, patch)
2009-12-02 23:14 UTC, Alexander V. Butenko
none Details | Review

Description Alexander V. Butenko 2009-11-24 19:10:07 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
Comment 1 Alexander V. Butenko 2009-12-02 00:11:46 UTC
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 2 Dan Winship 2009-12-02 15:05:31 UTC
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.
Comment 3 Alexander V. Butenko 2009-12-02 23:06:15 UTC
Created attachment 148972 [details] [review]
updated fix

i was so close :)
Comment 4 Alexander V. Butenko 2009-12-02 23:14:25 UTC
Created attachment 148973 [details] [review]
patch with test
Comment 5 Alexander V. Butenko 2009-12-12 03:14:22 UTC
ping? Patch looks very simple. Probably it can be commited and backported to a future 2.28.2 
release? Issue looks really weird.
Comment 6 Dan Winship 2009-12-14 20:44:01 UTC
fixed in git, will go into 2.28.2 later this week