summaryrefslogtreecommitdiffstats
path: root/bus/test.c
diff options
context:
space:
mode:
authorHavoc Pennington <hp@redhat.com>2003-08-11 02:11:58 +0000
committerHavoc Pennington <hp@redhat.com>2003-08-11 02:11:58 +0000
commitb29ea9115ea3277354b7ccbe442026279220f4ac (patch)
tree19e8a5880d7c324a7da4e712fdd76262470a54fe /bus/test.c
parentcefb84edc5f84011c5a171e5d052e37c56c55d27 (diff)
2003-08-10 Havoc Pennington <hp@pobox.com>
* 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
Diffstat (limited to 'bus/test.c')
-rw-r--r--bus/test.c11
1 files changed, 6 insertions, 5 deletions
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;