[glib/wip/tingping/socket-cancellation] gsocketclient: Ensure task is always returned on cancel



commit 7cc5ba7a7adbf4e756d23d910f73e00aa6c55212
Author: Patrick Griffis <tingping tingping se>
Date:   Sat Feb 9 10:24:13 2019 -0500

    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

 gio/gsocketclient.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/gio/gsocketclient.c b/gio/gsocketclient.c
index 29a5e5598..11e92e909 100644
--- a/gio/gsocketclient.c
+++ b/gio/gsocketclient.c
@@ -1567,7 +1567,7 @@ g_socket_client_connected_callback (GObject      *source,
   GProxy *proxy;
   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);
       connection_attempt_unref (attempt);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]