gsocketclient: Ensure task is always returned on cancel

It was possible for the individual connection attempts to be
cancelled without the main task getting returned.

Fixes libsoup#132
This commit is contained in:
Patrick Griffis 2019-02-09 10:24:13 -05:00 committed by Patrick Griffis
parent 97b41e10c7
commit 4dd1582625

View File

@ -1567,7 +1567,7 @@ g_socket_client_connected_callback (GObject *source,
GProxy *proxy; GProxy *proxy;
const gchar *protocol; const gchar *protocol;
if (g_cancellable_is_cancelled (attempt->cancellable) || task_completed_or_cancelled (data->task)) if (task_completed_or_cancelled (data->task) || g_cancellable_is_cancelled (attempt->cancellable))
{ {
g_object_unref (data->task); g_object_unref (data->task);
connection_attempt_unref (attempt); connection_attempt_unref (attempt);