[gnome-online-accounts] httpclient: Fix cancellation
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-online-accounts] httpclient: Fix cancellation
- Date: Wed, 5 Dec 2012 18:59:17 +0000 (UTC)
commit b2f94098829232bcb8294d5cefee85d5b9368f2d
Author: Debarshi Ray <debarshir gnome org>
Date: Tue Dec 4 17:46:17 2012 +0100
httpclient: Fix cancellation
Free the CheckData in an idle handler because soup_session_abort
invokes http_client_check_response_cb. Trying to disconnect the
GCancellable from a 'cancelled' signal handler will result in a
deadlock.
Fixes: https://bugzilla.gnome.org/689642
src/goabackend/goahttpclient.c | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/src/goabackend/goahttpclient.c b/src/goabackend/goahttpclient.c
index c8ce10a..7edd755 100644
--- a/src/goabackend/goahttpclient.c
+++ b/src/goabackend/goahttpclient.c
@@ -80,9 +80,11 @@ typedef struct
gchar *username;
} CheckAuthData;
-static void
-http_client_check_data_free (CheckData *data)
+static gboolean
+http_client_check_data_free (gpointer user_data)
{
+ CheckData *data = user_data;
+
if (data->cancellable_id > 0)
{
g_cancellable_disconnect (data->cancellable, data->cancellable_id);
@@ -93,6 +95,8 @@ http_client_check_data_free (CheckData *data)
g_object_unref (data->res);
g_object_unref (data->session);
g_slice_free (CheckData, data);
+
+ return G_SOURCE_REMOVE;
}
static void
@@ -157,7 +161,7 @@ http_client_check_response_cb (SoupSession *session, SoupMessage *msg, gpointer
g_simple_async_result_take_error (data->res, error);
g_simple_async_result_complete_in_idle (data->res);
- http_client_check_data_free (data);
+ g_idle_add (http_client_check_data_free, data);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]