summaryrefslogtreecommitdiff
path: root/bus/containers.c
diff options
context:
space:
mode:
authorSimon McVittie <smcv@collabora.com>2018-01-15 16:40:06 +0000
committerSimon McVittie <smcv@collabora.com>2018-02-16 15:27:51 +0000
commit624e9242840ed2b15fff5490c24802c47154f725 (patch)
tree6dd25af2c9eb8b2ac13422f5039fa824e5e1b531 /bus/containers.c
parent953bc072a3335a7fb232790a2d323094ad4a0e13 (diff)
downloaddbus-624e9242840ed2b15fff5490c24802c47154f725.tar.gz
containers: Add a method to ask to be sent the connection instance header
Signed-off-by: Simon McVittie <smcv@collabora.com> Reviewed-by: Philip Withnall <withnall@endlessm.com> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101899
Diffstat (limited to 'bus/containers.c')
-rw-r--r--bus/containers.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/bus/containers.c b/bus/containers.c
index 6eb327ff..a125b739 100644
--- a/bus/containers.c
+++ b/bus/containers.c
@@ -1297,6 +1297,35 @@ failed:
return FALSE;
}
+dbus_bool_t
+bus_containers_handle_request_header (DBusConnection *caller,
+ BusTransaction *transaction,
+ DBusMessage *message,
+ DBusError *error)
+{
+ DBusMessage *reply = NULL;
+ dbus_bool_t ret = FALSE;
+
+ reply = dbus_message_new_method_return (message);
+
+ /* We prepare the transaction before carrying out its side-effects,
+ * because otherwise it isn't transactional */
+ if (reply == NULL ||
+ !bus_transaction_send_from_driver (transaction, caller, reply))
+ {
+ BUS_SET_OOM (error);
+ goto out;
+ }
+
+ bus_connection_request_headers (caller,
+ BUS_EXTRA_HEADERS_CONTAINER_INSTANCE);
+ ret = TRUE;
+
+out:
+ dbus_clear_message (&reply);
+ return ret;
+}
+
void
bus_containers_stop_listening (BusContainers *self)
{