Skip to content

soup-session: Use a separate GCancellable instance for internal and external cancellation

tombailo requested to merge tombailo/libsoup:tombailo/session-cancellable into master

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.

Merge request reports