[libgnome-keyring] Print warning when we get kicked off the bus for some reason.
- From: Stefan Walter <stefw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgnome-keyring] Print warning when we get kicked off the bus for some reason.
- Date: Thu, 15 Sep 2011 18:46:35 +0000 (UTC)
commit 13ab2b86431b9d1d6df1751d95c1f5ca1884cc10
Author: Stef Walter <stefw collabora co uk>
Date: Thu Sep 15 19:00:52 2011 +0200
Print warning when we get kicked off the bus for some reason.
library/gkr-operation.c | 14 +++++++++++---
1 files changed, 11 insertions(+), 3 deletions(-)
---
diff --git a/library/gkr-operation.c b/library/gkr-operation.c
index b345d79..4398497 100644
--- a/library/gkr-operation.c
+++ b/library/gkr-operation.c
@@ -245,12 +245,20 @@ gkr_operation_complete_later (GkrOperation *op, GnomeKeyringResult res)
}
static DBusHandlerResult
-on_name_changed_filter (DBusConnection *connection, DBusMessage *message, void *user_data)
+on_connection_filter (DBusConnection *connection,
+ DBusMessage *message,
+ void *user_data)
{
const char *object_name;
const char *new_owner;
const char *old_owner;
+ /* org.freedesktop.DBus.Local.Disconnected() */
+ if (dbus_message_is_signal (message, DBUS_INTERFACE_LOCAL, "Disconnected")) {
+ g_warning ("dbus connection disconnected for unknown reason");
+ return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
+ }
+
/* org.freedesktop.DBus.NameOwnerChanged(STRING name, STRING old_owner, STRING new_owner) */
if (dbus_message_is_signal (message, DBUS_INTERFACE_DBUS, "NameOwnerChanged") &&
dbus_message_get_args (message, NULL, DBUS_TYPE_STRING, &object_name,
@@ -306,7 +314,7 @@ connect_to_service (void)
/* Listen for name owner changed signals */
rule = "type='signal',member='NameOwnerChanged',interface='org.freedesktop.DBus'";
dbus_bus_add_match (conn, rule, NULL);
- dbus_connection_add_filter (conn, on_name_changed_filter, NULL, NULL);
+ dbus_connection_add_filter (conn, on_connection_filter, NULL, NULL);
G_LOCK (dbus_connection);
{
@@ -466,7 +474,7 @@ send_with_reply_and_block (DBusConnection *conn, DBusMessage *message,
g_return_val_if_reached (NULL);
if (pending == NULL) {
- gkr_debug ("couldn't send message");
+ gkr_debug ("couldn't send message, dbus connection disconnected");
return NULL;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]