aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSzymon Janc <szymon.janc@tieto.com>2015-02-23 19:33:00 +0100
committerMarcel Holtmann <marcel@holtmann.org>2015-02-24 18:25:02 +0100
commitb93b6037b7b0b3964c28a1c0721f6726e7c1cf21 (patch)
treed01806be0de1c19e69903f9008d79dcb937d7428
parent61c0467e3576e8fd26faa736a58c7345a82490bd (diff)
downloadmmsd-b93b6037b7b0b3964c28a1c0721f6726e7c1cf21.tar.gz
gdbus: Fix not calling disconnect function
If daemon gets disconnected from D-Bus sender is NULL. Watches that was explicitly added with NULL sender (ie disconnected_signal in g_dbus_set_disconnect_function) should be called anyway.
-rw-r--r--gdbus/watch.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/gdbus/watch.c b/gdbus/watch.c
index 0d0054c..b60f650 100644
--- a/gdbus/watch.c
+++ b/gdbus/watch.c
@@ -523,9 +523,7 @@ static DBusHandlerResult message_filter(DBusConnection *connection,
member = dbus_message_get_member(message);
dbus_message_get_args(message, NULL, DBUS_TYPE_STRING, &arg, DBUS_TYPE_INVALID);
- /* Sender is always the owner */
- if (sender == NULL)
- return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
+ /* If sender != NULL it is always the owner */
for (current = listeners; current != NULL; current = current->next) {
data = current->data;
@@ -533,6 +531,9 @@ static DBusHandlerResult message_filter(DBusConnection *connection,
if (connection != data->connection)
continue;
+ if (!sender && data->owner)
+ continue;
+
if (data->owner && g_str_equal(sender, data->owner) == FALSE)
continue;