GNOME Bugzilla – Bug 637039
Improve support for cancellation with SoupRequest
Last modified: 2013-07-13 14:23:37 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.)
So this has been working correctly for a long time, and there's now a test in misc-test to verify that it works.