[glib/glib-2-34] g_socket_connection_connect_async: handle cancellation



commit ce92bea73571791f60762b2bb66e28e603543570
Author: Dan Winship <danw gnome org>
Date:   Tue Oct 16 10:22:56 2012 -0400

    g_socket_connection_connect_async: handle cancellation
    
    g_socket_connection_connect_finish() was returning TRUE when the
    connection attempt got cancelled. Fix that by using
    g_simple_async_result_set_check_cancellable(). (Git master doesn't
    have the bug because GTask behaves that way by default.)
    
    https://bugzilla.gnome.org/show_bug.cgi?id=686213

 gio/gsocketconnection.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/gio/gsocketconnection.c b/gio/gsocketconnection.c
index a881a47..0118b8c 100644
--- a/gio/gsocketconnection.c
+++ b/gio/gsocketconnection.c
@@ -206,6 +206,8 @@ g_socket_connection_connect_async (GSocketConnection   *connection,
     {
       GSource *source;
 
+      g_simple_async_result_set_check_cancellable (simple, cancellable);
+
       g_error_free (tmp_error);
       source = g_socket_create_source (connection->priv->socket,
 				       G_IO_OUT, cancellable);



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