Commit f0d2af22 authored by Committed by Claudio Saavedra
soup-session: Use a separate GCancellable instance for internal and external cancellation
This commit changes the way the user-supplied GCancellable is handled in the implementation of soup_session_send_async() and soup_session_send(). Previously the user-supplied GCancellable replaced the instance on the SoupMessageQueueItem used to queue the request. In the event of a request being internally re-queued, the GCancellable would be reset, which was problematic if the GCancellable had been passed in by client code which might be using the same instance to cancel soup requests and to perform application-specific cancellation. This commit changes the implementation of the above two functions so that the user-supplied instance is chained to the internal instance via a callback so that cancelling it cancels the internal instance while the two objects can maintain their own state. A test to test the use of a cancellable with soup_session_send() is also added to connection-test.c.
Showing with 105 additions and 4 deletions