From b29ea9115ea3277354b7ccbe442026279220f4ac Mon Sep 17 00:00:00 2001 From: Havoc Pennington Date: Mon, 11 Aug 2003 02:11:58 +0000 Subject: 2003-08-10 Havoc Pennington * tools/dbus-send.c (main): add --type argument, for now supporting only method_call and signal types. * tools/dbus-print-message.c: print message type * dbus/dbus-connection.c (_dbus_connection_new_for_transport): init connection->objects * doc/dbus-specification.sgml: fix sgml * bus/*.c: port over to object-instance API changes * test/test-service.c: ditto * dbus/dbus-message.c (dbus_message_create_header): allow #NULL name, we will have to fix up the rest of the code to also handle this (dbus_message_new): generic message-creation call (set_string_field): allow appending name field --- bus/test.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'bus/test.c') diff --git a/bus/test.c b/bus/test.c index 30cbcd05..ca10422f 100644 --- a/bus/test.c +++ b/bus/test.c @@ -107,6 +107,10 @@ client_disconnect_handler (DBusMessageHandler *handler, DBusMessage *message, void *user_data) { + if (!dbus_message_has_name (message, + DBUS_MESSAGE_LOCAL_DISCONNECT)) + return DBUS_HANDLER_RESULT_ALLOW_MORE_HANDLERS; + _dbus_verbose ("Removing client %p in disconnect handler\n", connection); @@ -138,7 +142,6 @@ dbus_bool_t bus_setup_debug_client (DBusConnection *connection) { DBusMessageHandler *disconnect_handler; - const char *to_handle[] = { DBUS_MESSAGE_LOCAL_DISCONNECT }; dbus_bool_t retval; disconnect_handler = dbus_message_handler_new (client_disconnect_handler, @@ -147,10 +150,8 @@ bus_setup_debug_client (DBusConnection *connection) if (disconnect_handler == NULL) return FALSE; - if (!dbus_connection_register_handler (connection, - disconnect_handler, - to_handle, - _DBUS_N_ELEMENTS (to_handle))) + if (!dbus_connection_add_filter (connection, + disconnect_handler)) { dbus_message_handler_unref (disconnect_handler); return FALSE; -- cgit