~ubuntu-branches/ubuntu/precise/glib2.0/precise-updates

« back to all changes in this revision

Viewing changes to debian/patches/bugzilla_gdbus_use_reliable_cancellation.patch

  • Committer: Package Import Robot
  • Author(s): Sebastien Bacher
  • Date: 2012-03-14 11:45:37 UTC
  • Revision ID: package-import@ubuntu.com-20120314114537-dq5o2d7oh4q01ork
Tags: 2.31.20-0ubuntu3
* debian/patches/bugzilla_gdbus_use_reliable_cancellation.patch,
  debian/patches/bugzilla_reliable_cancellable.patch:
  - patches from GNOME bug #672013, should make gdbus cancellation 
    reliable and fix dbusmenu lp: #953562
* debian/libglib2.0-0.symbols: 
  - updated for the new symbol

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
From 726516392b4e0facd813fe2b458457d9644fc4e5 Mon Sep 17 00:00:00 2001
 
2
From: Ryan Lortie <desrt@desrt.ca>
 
3
Date: Tue, 13 Mar 2012 16:41:57 -0400
 
4
Subject: [PATCH] GDBus: make use of reliable async cancellation
 
5
 
 
6
Call g_simple_async_result_set_check_cancellable() after all
 
7
GSimpleAsyncResult creation in order to take advantage of the new
 
8
reliable cancellation feature.
 
9
 
 
10
The guarantee of reliable cancellation fixes a bug in dbusmenu (which
 
11
was already assuming that cancellation was reliable).  See this bug:
 
12
https://bugs.launchpad.net/ubuntu/+source/libdbusmenu/+bug/953562
 
13
 
 
14
https://bugzilla.gnome.org/show_bug.cgi?id=672013
 
15
---
 
16
 gio/gdbusaddress.c    |    1 +
 
17
 gio/gdbusconnection.c |    5 +++++
 
18
 gio/gdbusprivate.c    |    1 +
 
19
 gio/gdbusproxy.c      |    3 +++
 
20
 4 files changed, 10 insertions(+), 0 deletions(-)
 
21
 
 
22
diff --git a/gio/gdbusaddress.c b/gio/gdbusaddress.c
 
23
index feb098b..77aff12 100644
 
24
--- a/gio/gdbusaddress.c
 
25
+++ b/gio/gdbusaddress.c
 
26
@@ -856,6 +856,7 @@ g_dbus_address_get_stream (const gchar         *address,
 
27
                                    callback,
 
28
                                    user_data,
 
29
                                    g_dbus_address_get_stream);
 
30
+  g_simple_async_result_set_check_cancellable (res, cancellable);
 
31
   data = g_new0 (GetStreamData, 1);
 
32
   data->address = g_strdup (address);
 
33
   g_simple_async_result_set_op_res_gpointer (res,
 
34
diff --git a/gio/gdbusconnection.c b/gio/gdbusconnection.c
 
35
index 1fce45f..7a4a08a 100644
 
36
--- a/gio/gdbusconnection.c
 
37
+++ b/gio/gdbusconnection.c
 
38
@@ -1246,6 +1246,7 @@ g_dbus_connection_flush (GDBusConnection     *connection,
 
39
                                       callback,
 
40
                                       user_data,
 
41
                                       g_dbus_connection_flush);
 
42
+  g_simple_async_result_set_check_cancellable (simple, cancellable);
 
43
   g_simple_async_result_run_in_thread (simple,
 
44
                                        flush_in_thread_func,
 
45
                                        G_PRIORITY_DEFAULT,
 
46
@@ -1459,6 +1460,7 @@ g_dbus_connection_close (GDBusConnection     *connection,
 
47
                                       callback,
 
48
                                       user_data,
 
49
                                       g_dbus_connection_close);
 
50
+  g_simple_async_result_set_check_cancellable (simple, cancellable);
 
51
   _g_dbus_worker_close (connection->worker, cancellable, simple);
 
52
   g_object_unref (simple);
 
53
 }
 
54
@@ -1916,6 +1918,7 @@ g_dbus_connection_send_message_with_reply_unlocked (GDBusConnection     *connect
 
55
                                       callback,
 
56
                                       user_data,
 
57
                                       g_dbus_connection_send_message_with_reply);
 
58
+  g_simple_async_result_set_check_cancellable (simple, cancellable);
 
59
 
 
60
   if (g_cancellable_is_cancelled (cancellable))
 
61
     {
 
62
@@ -5340,6 +5343,7 @@ g_dbus_connection_call_internal (GDBusConnection        *connection,
 
63
   state->simple = g_simple_async_result_new (G_OBJECT (connection),
 
64
                                              callback, user_data,
 
65
                                              g_dbus_connection_call_internal);
 
66
+  g_simple_async_result_set_check_cancellable (state->simple, cancellable);
 
67
   state->method_name = g_strjoin (".", interface_name, method_name, NULL);
 
68
 
 
69
   if (reply_type == NULL)
 
70
@@ -6859,6 +6863,7 @@ g_bus_get (GBusType             bus_type,
 
71
                                       callback,
 
72
                                       user_data,
 
73
                                       g_bus_get);
 
74
+  g_simple_async_result_set_check_cancellable (simple, cancellable);
 
75
 
 
76
   error = NULL;
 
77
   connection = get_uninitialized_connection (bus_type, cancellable, &error);
 
78
diff --git a/gio/gdbusprivate.c b/gio/gdbusprivate.c
 
79
index 3aa71cf..4b31fa7 100644
 
80
--- a/gio/gdbusprivate.c
 
81
+++ b/gio/gdbusprivate.c
 
82
@@ -191,6 +191,7 @@ _g_socket_read_with_control_messages (GSocket                 *socket,
 
83
                                             callback,
 
84
                                             user_data,
 
85
                                             _g_socket_read_with_control_messages);
 
86
+  g_simple_async_result_set_check_cancellable (data->simple, cancellable);
 
87
 
 
88
   if (!g_socket_condition_check (socket, G_IO_IN))
 
89
     {
 
90
diff --git a/gio/gdbusproxy.c b/gio/gdbusproxy.c
 
91
index 906faa4..a7c56d1 100644
 
92
--- a/gio/gdbusproxy.c
 
93
+++ b/gio/gdbusproxy.c
 
94
@@ -1695,6 +1695,7 @@ async_initable_init_second_async (GAsyncInitable      *initable,
 
95
                                             callback,
 
96
                                             user_data,
 
97
                                             NULL);
 
98
+  g_simple_async_result_set_check_cancellable (data->simple, cancellable);
 
99
 
 
100
   /* Check name ownership asynchronously - possibly also start the service */
 
101
   if (proxy->priv->name == NULL)
 
102
@@ -1840,6 +1841,7 @@ get_connection_cb (GObject       *source_object,
 
103
                                           data->callback,
 
104
                                           data->user_data,
 
105
                                           NULL);
 
106
+      g_simple_async_result_set_check_cancellable (simple, data->cancellable);
 
107
       g_simple_async_result_take_error (simple, error);
 
108
       g_simple_async_result_complete_in_idle (simple);
 
109
       g_object_unref (simple);
 
110
@@ -2698,6 +2700,7 @@ g_dbus_proxy_call_internal (GDBusProxy          *proxy,
 
111
                                       callback,
 
112
                                       user_data,
 
113
                                       g_dbus_proxy_call_internal);
 
114
+  g_simple_async_result_set_check_cancellable (simple, cancellable);
 
115
 
 
116
   G_LOCK (properties_lock);
 
117
 
 
118
-- 
 
119
1.7.9.1