diff options
Diffstat (limited to 'test/test-service.c')
-rw-r--r-- | test/test-service.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/test/test-service.c b/test/test-service.c index d07575e2..c72a43af 100644 --- a/test/test-service.c +++ b/test/test-service.c @@ -27,7 +27,6 @@ handle_echo (DBusConnection *connection, { DBusError error; DBusMessage *reply; - DBusMessageIter iter; char *s; dbus_error_init (&error); @@ -55,20 +54,22 @@ handle_echo (DBusConnection *connection, reply = dbus_message_new_method_return (message); if (reply == NULL) die ("No memory\n"); - - dbus_message_append_iter_init (message, &iter); - if (!dbus_message_iter_append_string (&iter, s)) + if (!dbus_message_append_args (reply, + DBUS_TYPE_STRING, s, + DBUS_TYPE_INVALID)) die ("No memory"); - + if (!dbus_connection_send (connection, reply, NULL)) die ("No memory\n"); + + fprintf (stderr, "Echo service echoed string: \"%s\"\n", s); dbus_free (s); dbus_message_unref (reply); - return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; + return DBUS_HANDLER_RESULT_HANDLED; } static DBusHandlerResult |