diff options
author | Philip Withnall <philip.withnall@collabora.co.uk> | 2015-12-02 15:36:42 +0000 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2015-12-04 14:28:32 +0200 |
commit | 80cb86b2a5d8cb0cffa70591cbd0e576d20fbbf1 (patch) | |
tree | cfe3ca1eec431e401120f4e501c7f165f31adb33 | |
parent | 1f2e03bc5262e412e822dec7c17a783c487c18cb (diff) | |
download | bluez-80cb86b2a5d8cb0cffa70591cbd0e576d20fbbf1.tar.gz |
gdbus: Drop message replies if the sender requested no reply
If the sender flags a D-Bus message as not expecting a reply, it is
against system bus policy to send a reply — sending one will result in
errors being sent to us by dbus-daemon.
Magically drop all replies to messages which request no reply.
ofonod is one process which sends BlueZ messages which request no
reply,
when it is setting up a hands-free agent.
This is not a complete fix. In an ideal world, the existing check for
G_DBUS_METHOD_FLAG_NOREPLY would be dropped, as the server should be
prepared to return a reply to every method, if the client requests and
expects one — otherwise the client will time out. However, that’s a
much
bigger change with a much bigger risk of breaking things, so I’ll stick
with this for now.
-rw-r--r-- | gdbus/object.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gdbus/object.c b/gdbus/object.c index 4cf2e2f94..a2201016c 100644 --- a/gdbus/object.c +++ b/gdbus/object.c @@ -258,7 +258,8 @@ static DBusHandlerResult process_message(DBusConnection *connection, reply = method->function(connection, message, iface_user_data); - if (method->flags & G_DBUS_METHOD_FLAG_NOREPLY) { + if (method->flags & G_DBUS_METHOD_FLAG_NOREPLY || + dbus_message_get_no_reply(message)) { if (reply != NULL) dbus_message_unref(reply); return DBUS_HANDLER_RESULT_HANDLED; |