diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2006-10-27 16:49:43 +0000 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2006-10-27 16:49:43 +0000 |
commit | 9323de9fb2af3db457516fc0d9b94da9db112e80 (patch) | |
tree | 7d49025397bd06a27d8d8b31d19088fe151488f2 /hcid/auth-agent.c | |
parent | 6493a5e58c8effb15460446c7039ef7725cb2b9f (diff) |
Send emtpy reply for cancel and release methods
Diffstat (limited to 'hcid/auth-agent.c')
-rw-r--r-- | hcid/auth-agent.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/hcid/auth-agent.c b/hcid/auth-agent.c index c0ab46c5..6ca07ff1 100644 --- a/hcid/auth-agent.c +++ b/hcid/auth-agent.c @@ -100,12 +100,30 @@ static DBusHandlerResult authorize_message(DBusConnection *conn, static DBusHandlerResult cancel_message(DBusConnection *conn, DBusMessage *msg, void *data) { + DBusMessage *reply; + + reply = dbus_message_new_method_return(msg); + if (!reply) { + fprintf(stderr, "Can't create reply message\n"); + return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; + } + + dbus_message_append_args(reply, DBUS_TYPE_INVALID); + + dbus_connection_send(conn, reply, NULL); + + dbus_connection_flush(conn); + + dbus_message_unref(reply); + return DBUS_HANDLER_RESULT_HANDLED; } static DBusHandlerResult release_message(DBusConnection *conn, DBusMessage *msg, void *data) { + DBusMessage *reply; + if (!dbus_message_get_args(msg, NULL, DBUS_TYPE_INVALID)) { fprintf(stderr, "Invalid arguments for Release method"); return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; @@ -116,6 +134,20 @@ static DBusHandlerResult release_message(DBusConnection *conn, __io_terminated = 1; + reply = dbus_message_new_method_return(msg); + if (!reply) { + fprintf(stderr, "Can't create reply message\n"); + return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; + } + + dbus_message_append_args(reply, DBUS_TYPE_INVALID); + + dbus_connection_send(conn, reply, NULL); + + dbus_connection_flush(conn); + + dbus_message_unref(reply); + return DBUS_HANDLER_RESULT_HANDLED; } |