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 710961 - Content of first request might be leaked into the second one making it unparsable
Content of first request might be leaked into the second one making it unpars...
Status: RESOLVED DUPLICATE of bug 710494
Product: libsoup
Classification: Core
Component: Misc
2.44.x
Other Linux
: Normal normal
: ---
Assigned To: libsoup-maint@gnome.bugs
libsoup-maint@gnome.bugs
Depends on:
Blocks:
 
 
Reported: 2013-10-27 11:52 UTC by Simonas Kazlauskas
Modified: 2013-10-27 16:20 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Minimal test case (982 bytes, text/plain)
2013-10-27 11:53 UTC, Simonas Kazlauskas
Details

Description Simonas Kazlauskas 2013-10-27 11:52:37 UTC
In case two requests are made on a persistent connection to the same host and contents of the first request body are not read, they will leak into the second request (before headers) making the second one unparsable.

To explain what happens step by step:

1. Make request to, for example, http://httpbin.org/status/418 with soup_session_send_async;
2. Do not read response contents at all, cancel the message instead (soup_session_cancel_message);
3. Make another request to the same host (e.g. http://httpbin.org/html);
4. The message will become corrupt and trying to soup_session_send_finish, one will get GError with “Could not parse HTTP response”.

Looking with gdb at soup_headers_parse_response, while parsing the second message the str argument will have the body of first request before the headers making it impossible to parse the request.

As things are now one has to explicitly read all the contents from the input stream after (or before) cancelling the message.
Comment 1 Simonas Kazlauskas 2013-10-27 11:53:08 UTC
Created attachment 258212 [details]
Minimal test case
Comment 2 Dan Winship 2013-10-27 16:20:28 UTC
thanks, already fixed in git, and will be in 2.44.2

*** This bug has been marked as a duplicate of bug 710494 ***