diff options
author | Carlos Garcia Campos <cgarcia@igalia.com> | 2020-11-10 17:20:20 +0100 |
---|---|---|
committer | Carlos Garcia Campos <cgarcia@igalia.com> | 2020-11-15 11:27:17 +0100 |
commit | 3c601cdc2adfa3184cfb978df4dc8fd7db53ba32 (patch) | |
tree | ac7ac211e4580d802ebbc834fe6143856baa2280 | |
parent | d615e33ac95fd6611f8fb06d245f4330ca423ac0 (diff) | |
download | libsoup-3c601cdc2adfa3184cfb978df4dc8fd7db53ba32.tar.gz |
connection: clear the cancellable before completing the GTask
The session calls soup_connection_disconnect() on the GTask callback in
case of error. At that point cancellable should be NULL already, since
the operation completed.
Fixes #206
-rw-r--r-- | libsoup/soup-connection.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libsoup/soup-connection.c b/libsoup/soup-connection.c index 9597097b..e6a79bf7 100644 --- a/libsoup/soup-connection.c +++ b/libsoup/soup-connection.c @@ -553,17 +553,17 @@ connect_async_ready_cb (GSocketClient *client, connection = g_socket_client_connect_finish (client, result, &error); if (!connection) { + g_clear_object (&priv->cancellable); g_task_return_error (task, error); g_object_unref (task); - g_clear_object (&priv->cancellable); return; } if (!soup_connection_connected (conn, connection, &error)) { + g_clear_object (&priv->cancellable); g_task_return_error (task, error); g_object_unref (task); g_object_unref (connection); - g_clear_object (&priv->cancellable); return; } @@ -743,9 +743,9 @@ soup_connection_tunnel_handshake_async (SoupConnection *conn, tls_connection = new_tls_connection (conn, G_SOCKET_CONNECTION (priv->connection), &error); if (!tls_connection) { + g_clear_object (&priv->cancellable); g_task_return_error (task, error); g_object_unref (task); - g_clear_object (&priv->cancellable); return; } |