diff options
author | Dan Winship <danw@gnome.org> | 2013-11-04 16:41:10 -0500 |
---|---|---|
committer | Dan Winship <danw@gnome.org> | 2013-11-04 16:48:41 -0500 |
commit | 4e755ba87e2937ce32c53c2983d4efe8b9121541 (patch) | |
tree | 7dfb8b0289835219256fe084198315024cc83905 /libsoup/soup-client-input-stream.c | |
parent | da167aad39438d4df33df189c97bd07e989d38d0 (diff) | |
download | libsoup-4e755ba87e2937ce32c53c2983d4efe8b9121541.tar.gz |
Fix SoupClientInputStream close on error
g_input/output_stream_close() always mark their stream closed, even on
error, even if their cancellable is pre-cancelled. That means we have
to guarantee that soup_message_io_finished() gets called when a
SoupClientInputStream is closed, even if an error occurs while
closing.
https://bugzilla.gnome.org/show_bug.cgi?id=711260
Diffstat (limited to 'libsoup/soup-client-input-stream.c')
-rw-r--r-- | libsoup/soup-client-input-stream.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/libsoup/soup-client-input-stream.c b/libsoup/soup-client-input-stream.c index 87fa49d6..0264cb79 100644 --- a/libsoup/soup-client-input-stream.c +++ b/libsoup/soup-client-input-stream.c @@ -128,9 +128,12 @@ soup_client_input_stream_close_fn (GInputStream *stream, GError **error) { SoupClientInputStream *cistream = SOUP_CLIENT_INPUT_STREAM (stream); + gboolean success; - return soup_message_io_run_until_finish (cistream->priv->msg, TRUE, - cancellable, error); + success = soup_message_io_run_until_finish (cistream->priv->msg, TRUE, + NULL, error); + soup_message_io_finished (cistream->priv->msg); + return success; } static gboolean @@ -158,6 +161,8 @@ close_async_ready (SoupMessage *msg, gpointer user_data) return TRUE; } + soup_message_io_finished (cistream->priv->msg); + if (error) { g_task_return_error (task, error); g_object_unref (task); |