soup_session_cancel_message: fix up, especially in sync sessions
authorDan Winship <danw@gnome.org>
Mon, 10 Jan 2011 18:47:52 +0000 (13:47 -0500)
committerDan Winship <danw@gnome.org>
Mon, 10 Jan 2011 18:54:27 +0000 (13:54 -0500)
commit0f7ff260847a703ff90d77b892d6048e26cc768c
tree20146b3c7801fe5cd9cd4467d7ca5a903dbaf4e4
parent223db09654af305adddc3cf4389dca4329b634b1
soup_session_cancel_message: fix up, especially in sync sessions

Cancelling a message from another thread had some race conditions that
could sometimes cause crashes. Fix things up a bit by using
GCancellable to interrupt the I/O, rather than calling
soup_message_io_finished() directly.

Also added a test for this case to tests/misc-test, although
unfortunately due to the raciness of the bug, it only failed
sporadically even before the fix (but seems to fail never now).

https://bugzilla.gnome.org/show_bug.cgi?id=637741
libsoup/soup-message-io.c
libsoup/soup-message-queue.c
libsoup/soup-session-async.c
libsoup/soup-session.c
tests/misc-test.c
tests/timeout-test.c