After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 659465 - gdbusconnection: Add convenience _with_unix_fd_list variant for g_dbus_connection_emit_signal()
gdbusconnection: Add convenience _with_unix_fd_list variant for g_dbus_connec...
Status: RESOLVED WONTFIX
Product: glib
Classification: Platform
Component: gio
2.29.x
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2011-09-19 12:11 UTC by Christophe Dumez
Modified: 2011-09-19 14:44 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Proposed patch (5.92 KB, patch)
2011-09-19 12:11 UTC, Christophe Dumez
none Details | Review

Description Christophe Dumez 2011-09-19 12:11:12 UTC
Created attachment 196931 [details] [review]
Proposed patch

The following commit added support for new org.gtk.GDBus.C.UnixFD annotation as well as convenience _with_unix_fd_list variants to GDBusConnection, GDBusProxy and GDBusMethodInvocation types to easily support it:
http://git.gnome.org/browse/glib/commit/?id=c404dbed11bc8bf4212d15719ef3a87ebf76efff

However, no _with_unix_fd_list variant was added for g_dbus_connection_emit_signal(). I believe this is useful and should be provided as well.
Please find attached a patch to add g_dbus_connection_emit_signal_with_unix_fd_list() to GDBusConnection.

Could someone please review it and possibly commit it if acceptable?
Comment 1 David Zeuthen (not reading bugmail) 2011-09-19 13:58:40 UTC
No, this wasn't added because a) it's generally not useful (except for benchmarking etc.); and b) you can already do this by just constructing a suitable GDBusMessage and sending it yourself. For future reference, the patch is missing additions to gio/gio.symbols and docs/reference/gio/gio-sections.txt. But no need to update the patch because of a) and b). Thanks anyway.
Comment 2 Christophe Dumez 2011-09-19 14:25:52 UTC
I was looking at evolution-data-server 3.2 code and it is using g_dbus_connection_emit_signal() to send data back from the server to the client.
As a consequence, I felt it would be useful to have an equivalent that supports FD passing.

I realize it is possible to do it by constructing the GDBusMessage myself but it felt cleaner to keep using signals as in the rest of the E-D-S code.

If you still feel this is not useful, then I'll probably use the alternative. 
However, the code will be different for some functions just because they use FD passing.

I personally don't see much harm in having a _with_unix_fd_list variant for g_dbus_connection_emit_signal() as well.
Comment 3 David Zeuthen (not reading bugmail) 2011-09-19 14:44:42 UTC
Nah - it's not really good D-Bus API design to attach file descriptors to signals (especially not multi-cast signals - consider that this puts stress on the bus daemon since it has to duplicate and pass the fd N times - one for each recipient of the signal) so I don't think we should add convenience API for it. The only reason that the _with_unix_fd_list variants were added was to make life simpler for the code generator.