summaryrefslogtreecommitdiff
path: root/libsoup
diff options
context:
space:
mode:
Diffstat (limited to 'libsoup')
-rw-r--r--libsoup/http1/soup-client-message-io-http1.c9
-rw-r--r--libsoup/soup-session.c5
2 files changed, 9 insertions, 5 deletions
diff --git a/libsoup/http1/soup-client-message-io-http1.c b/libsoup/http1/soup-client-message-io-http1.c
index dff6bbf2..8c647bfa 100644
--- a/libsoup/http1/soup-client-message-io-http1.c
+++ b/libsoup/http1/soup-client-message-io-http1.c
@@ -860,9 +860,12 @@ soup_client_message_io_http1_run (SoupClientMessageIO *iface,
soup_client_message_io_http1_get_priority (client_io));
g_source_attach (io->io_source, g_main_context_get_thread_default ());
} else {
- if ((SoupClientMessageIOHTTP1 *)soup_message_get_io_data (msg) == client_io)
- soup_message_io_finish (msg, error);
- g_error_free (error);
+ if ((SoupClientMessageIOHTTP1 *)soup_message_get_io_data (msg) == client_io) {
+ g_assert (!client_io->msg_io->item->error);
+ client_io->msg_io->item->error = g_steal_pointer (&error);
+ soup_message_io_finish (msg, client_io->msg_io->item->error);
+ }
+ g_clear_error (&error);
}
diff --git a/libsoup/soup-session.c b/libsoup/soup-session.c
index de0da49c..cfd4ef07 100644
--- a/libsoup/soup-session.c
+++ b/libsoup/soup-session.c
@@ -1518,6 +1518,7 @@ tunnel_message_completed (SoupMessage *msg, SoupMessageIOCompletion completion,
conn = soup_message_get_connection (tunnel_item->msg);
if (conn) {
g_object_unref (conn);
+ g_clear_object (&tunnel_item->error);
tunnel_item->state = SOUP_MESSAGE_RUNNING;
soup_session_send_queue_item (session, tunnel_item,
(SoupMessageIOCompletionFn)tunnel_message_completed);
@@ -1532,8 +1533,8 @@ tunnel_message_completed (SoupMessage *msg, SoupMessageIOCompletion completion,
soup_session_unqueue_item (session, tunnel_item);
status = soup_message_get_status (tunnel_item->msg);
- if (!SOUP_STATUS_IS_SUCCESSFUL (status) || item->state == SOUP_MESSAGE_RESTARTING) {
- tunnel_complete (tunnel_item, status, NULL);
+ if (!SOUP_STATUS_IS_SUCCESSFUL (status) || tunnel_item->error || item->state == SOUP_MESSAGE_RESTARTING) {
+ tunnel_complete (tunnel_item, status, g_steal_pointer (&tunnel_item->error));
return;
}