summaryrefslogtreecommitdiff
path: root/bus
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2011-03-10 04:10:31 +0100
committerLennart Poettering <lennart@poettering.net>2011-03-11 23:08:25 +0100
commitf934a967e3b628ac11839117ce0aa082c9f37803 (patch)
tree5b8d2fb8e33e302b42666f4a185df3e6e27160a2 /bus
parent2c34514620c4b79ea4ec71d1db583379138d01ac (diff)
connection: hook UnknownObject and UnknownInterface up where appropriate
This makes use of UnknownInterface and UnknownObject where appropriate in the D-Bus core. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34527 Reviewed-By: Simon McVittie <simon.mcvittie@collabora.co.uk>
Diffstat (limited to 'bus')
-rw-r--r--bus/driver.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/bus/driver.c b/bus/driver.c
index 1e9573ee..425a3d5a 100644
--- a/bus/driver.c
+++ b/bus/driver.c
@@ -1921,6 +1921,7 @@ bus_driver_handle_message (DBusConnection *connection,
const char *name, *sender, *interface;
const InterfaceHandler *ih;
const MessageHandler *mh;
+ dbus_bool_t found_interface = FALSE;
_DBUS_ASSERT_ERROR_IS_CLEAR (error);
@@ -1957,6 +1958,8 @@ bus_driver_handle_message (DBusConnection *connection,
if (interface != NULL && strcmp (interface, ih->name) != 0)
continue;
+ found_interface = TRUE;
+
for (mh = ih->message_handlers; mh->name != NULL; mh++)
{
if (strcmp (mh->name, name) != 0)
@@ -1998,7 +2001,7 @@ bus_driver_handle_message (DBusConnection *connection,
_dbus_verbose ("No driver handler for message \"%s\"\n",
name);
- dbus_set_error (error, DBUS_ERROR_UNKNOWN_METHOD,
+ dbus_set_error (error, found_interface ? DBUS_ERROR_UNKNOWN_METHOD : DBUS_ERROR_UNKNOWN_INTERFACE,
"%s does not understand message %s",
DBUS_SERVICE_DBUS, name);