GNOME Bugzilla – Bug 672239
request NO_REPLY from g_dbus_connection_call() with no async callback
Last modified: 2012-03-19 16:41:51 UTC
In the case that the user has no callback for g_dbus_connection_call() then we should do a bit of cleverness and instruct the remote side not to reply to us. We should do the same for _call() methods on proxies as well, but not for any calls that deal with GDBusMessage directly. For those methods, the user has direct access to the GDBusMessage and can set the flag for themselves and also the user can see the serial number (so they might be processing the reply in a filter). We discussed the possibility of instead adding a new GDBusCallFlags to make the setting of the flag more explicit, but after thinking about it, this raises some ugly edge cases: what if the user sets the flag, but gives a callback anyway? After a discussion of the risks, David and I agree that the best way to proceed is to automatically set the no-reply flag if the callback is NULL. If this new behaviour causes problems for anybody (and it's hard to imagine how it could) then they can always work around it by giving a do-nothing callback.
Created attachment 209945 [details] [review] GDBus: set no-reply flag on calls with no callback If g_dbus_connection_call() or g_dbus_proxy_call() are given a NULL callback then set the no-reply flag on the outgoing D-Bus message.
The patch needs to be applied on top of the one from bug 672249.
Comment on attachment 209945 [details] [review] GDBus: set no-reply flag on calls with no callback Looks good to me, thanks!
Attachment 209945 [details] pushed as 2afbc42 - GDBus: set no-reply flag on calls with no callback