Skip to content
  • tombailo's avatar
    soup-session: Use a separate GCancellable instance for internal and external cancellation · f0d2af22
    tombailo authored and Claudio Saavedra's avatar Claudio Saavedra committed
    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.
    f0d2af22