[gnome-keyring] daemon: Fix logic for calling UnregisterClient() on the session.



commit 066ebbd8ba1d81a4f80a3eacdbef017435e9c91d
Author: Stef Walter <stefw collabora co uk>
Date:   Sat Apr 30 07:27:49 2011 +0200

    daemon: Fix logic for calling UnregisterClient() on the session.
    
     * Don't unregister client if "Disconnected" signal was received.
     * Don't block on UnregisterClient(), just send and flush.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=648958

 daemon/dbus/gkd-dbus-session.c |   16 +++-------------
 1 files changed, 3 insertions(+), 13 deletions(-)
---
diff --git a/daemon/dbus/gkd-dbus-session.c b/daemon/dbus/gkd-dbus-session.c
index 2810892..c5807dd 100644
--- a/daemon/dbus/gkd-dbus-session.c
+++ b/daemon/dbus/gkd-dbus-session.c
@@ -78,8 +78,6 @@ unregister_daemon_in_session (DBusConnection *conn)
 {
 	DBusMessageIter args;
 	DBusMessage *msg;
-	DBusMessage *reply;
-	DBusError derr = { 0 };
 
 	if (client_session_rule) {
 		dbus_bus_remove_match (conn, client_session_rule, NULL);
@@ -100,16 +98,11 @@ unregister_daemon_in_session (DBusConnection *conn)
 	if (!dbus_message_iter_append_basic (&args, DBUS_TYPE_OBJECT_PATH, &client_session_path))
 		g_return_if_reached ();
 
-	reply = dbus_connection_send_with_reply_and_block (conn, msg, 1000, &derr);
+	dbus_message_set_no_reply (msg, TRUE);
+	dbus_connection_send (conn, msg, NULL);
+	dbus_connection_flush (conn);
 	dbus_message_unref (msg);
 
-	if (!reply) {
-		g_message ("dbus failure unregistering from session: %s", derr.message);
-		return;
-	}
-
-	dbus_message_unref (reply);
-
 	g_free (client_session_path);
 	client_session_path = NULL;
 }
@@ -131,7 +124,6 @@ signal_filter (DBusConnection *conn, DBusMessage *msg, void *user_data)
 		gkd_main_quit ();
 		return DBUS_HANDLER_RESULT_HANDLED;
 	} else if (dbus_message_is_signal (msg, DBUS_INTERFACE_LOCAL, "Disconnected")) {
-		unregister_daemon_in_session (conn);
 		gkd_main_quit ();
 		return DBUS_HANDLER_RESULT_HANDLED;
 	}
@@ -142,8 +134,6 @@ signal_filter (DBusConnection *conn, DBusMessage *msg, void *user_data)
 void
 gkd_dbus_session_cleanup (DBusConnection *conn)
 {
-	unregister_daemon_in_session (conn);
-
 	g_free (client_session_path);
 	client_session_path = NULL;
 



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