summaryrefslogtreecommitdiffstats
path: root/bus
diff options
context:
space:
mode:
authorHavoc Pennington <hp@redhat.com>2003-08-12 04:15:49 +0000
committerHavoc Pennington <hp@redhat.com>2003-08-12 04:15:49 +0000
commit1d1b0f20a467cf1cbdcaf81fbad3a111bcff6c48 (patch)
tree26a8b3863455d26c4dc8805077a318fe8bb6d610 /bus
parent5c1a8e44903bd1dedc8cbefad78b0c8b61daada5 (diff)
2003-08-12 Havoc Pennington <hp@pobox.com>
* bus/dispatch.c (bus_dispatch): make this return proper DBusHandlerResult to avoid DBUS_ERROR_UNKNOWN_METHOD * dbus/dbus-errors.c (dbus_set_error): use _dbus_string_append_printf_valist * dbus/dbus-string.c (_dbus_string_append_printf_valist) (_dbus_string_append_printf): new * dbus/dbus-errors.h (DBUS_ERROR_UNKNOWN_MESSAGE): change to UNKNOWN_METHOD * dbus/dbus-connection.c (dbus_connection_dispatch): handle DBUS_HANDLER_RESULT_NEED_MEMORY; send default error reply if a message is unhandled.
Diffstat (limited to 'bus')
-rw-r--r--bus/dispatch.c12
-rw-r--r--bus/driver.c2
2 files changed, 9 insertions, 5 deletions
diff --git a/bus/dispatch.c b/bus/dispatch.c
index 6902da65..e8f0c9ba 100644
--- a/bus/dispatch.c
+++ b/bus/dispatch.c
@@ -100,7 +100,7 @@ bus_dispatch_broadcast_message (BusTransaction *transaction,
return TRUE;
}
-static void
+static DBusHandlerResult
bus_dispatch (DBusConnection *connection,
DBusMessage *message)
{
@@ -108,6 +108,9 @@ bus_dispatch (DBusConnection *connection,
DBusError error;
BusTransaction *transaction;
BusContext *context;
+ DBusHandlerResult result;
+
+ result = DBUS_HANDLER_RESULT_HANDLED;
transaction = NULL;
dbus_error_init (&error);
@@ -145,6 +148,7 @@ bus_dispatch (DBusConnection *connection,
/* DBusConnection also handles some of these automatically, we leave
* it to do so.
*/
+ result = DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
goto out;
}
@@ -295,6 +299,8 @@ bus_dispatch (DBusConnection *connection,
}
dbus_connection_unref (connection);
+
+ return result;
}
static DBusHandlerResult
@@ -303,9 +309,7 @@ bus_dispatch_message_handler (DBusMessageHandler *handler,
DBusMessage *message,
void *user_data)
{
- bus_dispatch (connection, message);
-
- return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
+ return bus_dispatch (connection, message);
}
static void
diff --git a/bus/driver.c b/bus/driver.c
index 6e0024b0..22e36e0a 100644
--- a/bus/driver.c
+++ b/bus/driver.c
@@ -662,7 +662,7 @@ bus_driver_handle_message (DBusConnection *connection,
_dbus_verbose ("No driver handler for %s\n", name);
- dbus_set_error (error, DBUS_ERROR_UNKNOWN_MESSAGE,
+ dbus_set_error (error, DBUS_ERROR_UNKNOWN_METHOD,
"%s does not understand message %s",
DBUS_SERVICE_DBUS, name);