diff options
author | Havoc Pennington <hp@redhat.com> | 2003-08-12 04:15:49 +0000 |
---|---|---|
committer | Havoc Pennington <hp@redhat.com> | 2003-08-12 04:15:49 +0000 |
commit | 1d1b0f20a467cf1cbdcaf81fbad3a111bcff6c48 (patch) | |
tree | 26a8b3863455d26c4dc8805077a318fe8bb6d610 /bus/dispatch.c | |
parent | 5c1a8e44903bd1dedc8cbefad78b0c8b61daada5 (diff) | |
download | dbus-1d1b0f20a467cf1cbdcaf81fbad3a111bcff6c48.tar.gz |
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/dispatch.c')
-rw-r--r-- | bus/dispatch.c | 12 |
1 files changed, 8 insertions, 4 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 |