[pulseaudio-tickets] [Bug 104646] org.bluez.MediaEndpoint1.Release should do nothing, not raise a DBUS error

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Thu Jan 18 20:56:13 UTC 2018


https://bugs.freedesktop.org/show_bug.cgi?id=104646

--- Comment #6 from Tanu Kaskinen <tanuk at iki.fi> ---
Thanks for testing, I submitted the patch to the mailing list now.

It's a valid point that it's very easy to forget to check the no_reply flag if
the checking isn't centralized. That said, it's also very rare that a method
call doesn't expect a reply. I'm not motivated enough to work on this.

If someone else wants to work on it, here are my thoughts about the possible
implementation:

Ideally libdbus would implement the checking in dbus_connection_send(). Maybe
it can't be changed to do that unconditionally, but applications could set an
option in the DBusConnection object if they want to enable the filtering.

If the libdbus maintainers reject the feature, then we can do the filtering in
PulseAudio, although I don't see any pretty solutions. I can think of two
not-so-pretty solutions:

1) Ban the direct use of dbus_connection_send(), and use a wrapper function
instead. The wrapper function would take a boolean argument indicating whether
or not to actually send the message. That would force every caller to think
about whether or not the message should be sent. It would be nice if the send
wrapper could get the no_reply flag directly from the message that is being
sent, so that the explicit boolean argument wouldn't be needed, but libdbus
doesn't seem to provide a function for getting the "in-reply-to" message from
the reply message. That feature might be feasible to get added to libdbus,
though.

2) Ban the direct use of dbus_message_new_method_return(),
dbus_message_new_error() and dbus_message_new_error_printf(), and use wrapper
functions instead. The wrapper functions would fail if the original method call
didn't request a reply.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are the QA Contact for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/pulseaudio-bugs/attachments/20180118/80aebc2b/attachment.html>


More information about the pulseaudio-bugs mailing list