[evolution-data-server/gnome-3-30] [evolution-dbus-session] Handle method calls with GUnixFDList
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server/gnome-3-30] [evolution-dbus-session] Handle method calls with GUnixFDList
- Date: Wed, 14 Nov 2018 22:36:43 +0000 (UTC)
commit 1e89f981724b6963fa51b2c60ef94d6a933fbd7d
Author: Milan Crha <mcrha redhat com>
Date: Wed Nov 14 23:34:51 2018 +0100
[evolution-dbus-session] Handle method calls with GUnixFDList
This is required to have properly propagated calls like OpenFile,
which use it.
Related to https://gitlab.gnome.org/GNOME/evolution/issues/169
.../evolution-dbus-session.c | 54 +++++++++++++++++-----
1 file changed, 43 insertions(+), 11 deletions(-)
---
diff --git a/src/tools/evolution-dbus-session/evolution-dbus-session.c
b/src/tools/evolution-dbus-session/evolution-dbus-session.c
index 575b5bbcd..7c53d9dd2 100644
--- a/src/tools/evolution-dbus-session/evolution-dbus-session.c
+++ b/src/tools/evolution-dbus-session/evolution-dbus-session.c
@@ -164,25 +164,57 @@ handle_method_call_cb (GDBusConnection *connection,
GDBusMethodInvocation *invocation,
gpointer user_data)
{
+#ifdef G_OS_UNIX
+ GDBusMessage *message;
+ GUnixFDList *in_fd_list, *out_fd_list = NULL;
+#endif
ProxyData *pd = user_data;
GVariant *result;
GError *error = NULL;
g_return_if_fail (pd != NULL);
- result = g_dbus_connection_call_sync (g_dbus_proxy_get_connection (pd->proxy),
- g_dbus_proxy_get_name (pd->proxy),
- object_path,
- interface_name,
- method_name,
- parameters,
- NULL,
- G_DBUS_CALL_FLAGS_NONE,
- DBUS_CALL_TIMEOUT,
- NULL, &error);
+#ifdef G_OS_UNIX
+ message = g_dbus_method_invocation_get_message (invocation);
+ in_fd_list = g_dbus_message_get_unix_fd_list (message);
+
+ if (in_fd_list) {
+ result = g_dbus_connection_call_with_unix_fd_list_sync (g_dbus_proxy_get_connection
(pd->proxy),
+ g_dbus_proxy_get_name (pd->proxy),
+ object_path,
+ interface_name,
+ method_name,
+ parameters,
+ NULL,
+ G_DBUS_CALL_FLAGS_NONE,
+ DBUS_CALL_TIMEOUT,
+ in_fd_list,
+ &out_fd_list,
+ NULL, &error);
+ } else {
+#endif
+ result = g_dbus_connection_call_sync (g_dbus_proxy_get_connection (pd->proxy),
+ g_dbus_proxy_get_name (pd->proxy),
+ object_path,
+ interface_name,
+ method_name,
+ parameters,
+ NULL,
+ G_DBUS_CALL_FLAGS_NONE,
+ DBUS_CALL_TIMEOUT,
+ NULL, &error);
+#ifdef G_OS_UNIX
+ }
+#endif
if (result) {
- g_dbus_method_invocation_return_value (invocation, result);
+ #ifdef G_OS_UNIX
+ if (out_fd_list) {
+ g_dbus_method_invocation_return_value_with_unix_fd_list (invocation, result,
out_fd_list);
+ g_object_unref (out_fd_list);
+ } else
+ #endif
+ g_dbus_method_invocation_return_value (invocation, result);
g_variant_unref (result);
} else {
g_dbus_method_invocation_return_gerror (invocation, error);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]