diff options
author | Radoslaw Pajak <r.pajak@samsung.com> | 2013-10-04 16:52:51 +0200 |
---|---|---|
committer | Lubomir Rintel <lkundrak@v3.sk> | 2015-02-11 11:50:02 +0100 |
commit | 5333dbbdd1461ca597f6bc1d268f9b59a5baaaea (patch) | |
tree | befa31cbf6e9d21abea5ec866cf4787246ca0f22 /bus/dispatch.c | |
parent | 66a6d36b3e88a3427da51cbfcbc8c86c51df016a (diff) |
[daemon-dev][daemon-fix][lib-dev] Added sending NameLost and NameAcquired messages and fixes
- added sending NameLost and NameAcquired signals/messages
- added removing phantom connections when owner has disconnected
- added possibility to match against Id Added and Id removed kdbus signals
- ReleaseName method fixed and cleaned
- fixed phantom connection disconnecting (cleaning)
- some comments enhanced
- removed unnecessary comments and debugs
Change-Id: I2e1d7bde924c9312f77f8d3ef76a4be9287feadd
Signed-off-by: Radoslaw Pajak <r.pajak@samsung.com>
Diffstat (limited to 'bus/dispatch.c')
-rw-r--r-- | bus/dispatch.c | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/bus/dispatch.c b/bus/dispatch.c index 9a98c6dc..90706a1f 100644 --- a/bus/dispatch.c +++ b/bus/dispatch.c @@ -36,6 +36,7 @@ #include <dbus/dbus-internals.h> #include <dbus/dbus-misc.h> #include <string.h> +#include "kdbus-d.h" #ifdef HAVE_UNIX_FD_PASSING #include <dbus/dbus-sysdeps-unix.h> @@ -218,6 +219,14 @@ bus_dispatch (DBusConnection *connection, } #endif /* DBUS_ENABLE_VERBOSE_MODE */ + /* Create our transaction */ + transaction = bus_transaction_new (context); + if (transaction == NULL) + { + BUS_SET_OOM (&error); + goto out; + } + /* If service_name is NULL, if it's a signal we send it to all * connections with a match rule. If it's not a signal, there * are some special cases here but mostly we just bail out. @@ -240,18 +249,19 @@ bus_dispatch (DBusConnection *connection, result = DBUS_HANDLER_RESULT_NOT_YET_HANDLED; goto out; } - } - /* Create our transaction */ - transaction = bus_transaction_new (context); - if (transaction == NULL) - { - BUS_SET_OOM (&error); - goto out; + if(bus_context_is_kdbus(context)) + { + if (dbus_message_is_signal (message, DBUS_INTERFACE_DBUS, "NameOwnerChanged")) + { + handleNameOwnerChanged(message, transaction, connection); + goto out; + } + } } /* Assign a sender to the message */ - if(!bus_context_is_kdbus(context)) /* todo kdbus inclusion - if not kdbus daemon */ + if(bus_context_is_kdbus(context) == FALSE) //if using kdbus, sender must be set on library side if (bus_connection_is_active (connection)) { sender = bus_connection_get_name (connection); |