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 637039 - Improve support for cancellation with SoupRequest
Improve support for cancellation with SoupRequest
Status: RESOLVED FIXED
Product: libsoup
Classification: Core
Component: API
2.31.x
Other Linux
: Normal normal
: ---
Assigned To: libsoup-maint@gnome.bugs
libsoup-maint@gnome.bugs
Depends on:
Blocks:
 
 
Reported: 2010-12-11 18:33 UTC by Philip Withnall
Modified: 2013-07-13 14:23 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Philip Withnall 2010-12-11 18:33:35 UTC
Cancelling a request started with soup_session_send_message() is race-prone at the moment, since soup_session_cancel_message() doesn't have any effect until after the message has been added to the session's queue — which happens somewhere deep inside soup_session_send_message().

The only way to do it safely at the moment is to lock cancellation from before calling soup_session_send_message() until the SoupSession::request-queued signal is emitted, which is a little ugly.

I implemented this fix in libgdata recently in this commit: http://git.gnome.org/browse/libgdata/commit/?id=3fe595e302eaed8af46b7b3d58313548e4473584

In the bright new SoupRequest future, it would be nice to make sure that cancelling a request is simple and not race-prone. Having SoupRequests take a GCancellable and do useful things with it would be great. (They might already do this, which would be wonderful. I don't know — I haven't looked.)
Comment 1 Dan Winship 2013-07-13 14:23:37 UTC
So this has been working correctly for a long time, and there's now a test in misc-test to verify that it works.