From 54b943432c7c947db88066751dd36a372cc9a618 Mon Sep 17 00:00:00 2001 From: Havoc Pennington Date: Mon, 18 Jun 2007 19:32:51 +0000 Subject: 2007-06-18 Havoc Pennington * doc/dbus-specification.xml: document org.freedesktop.DBus.GetId() * bus/driver.c (bus_driver_handle_get_id): implement org.freedesktop.DBus.GetId() * bus/bus.c (bus_context_new): generate a unique ID for each bus context * dbus/dbus-connection.c (dbus_connection_get_server_id): new function * dbus/dbus-bus.c (dbus_bus_get_id): new function * dbus/dbus-server.c (dbus_server_get_id): new function --- dbus/dbus-transport.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'dbus/dbus-transport.c') diff --git a/dbus/dbus-transport.c b/dbus/dbus-transport.c index 3edef937..d78727cf 100644 --- a/dbus/dbus-transport.c +++ b/dbus/dbus-transport.c @@ -791,6 +791,22 @@ _dbus_transport_get_address (DBusTransport *transport) return transport->address; } +/** + * Gets the id of the server we are connected to (see + * dbus_server_get_id()). Only works on client side. + * + * @param transport the transport + * @returns transport's server's id or #NULL if we are the server side + */ +const char* +_dbus_transport_get_server_id (DBusTransport *transport) +{ + if (transport->is_server) + return NULL; + else + return transport->expected_guid; +} + /** * Handles a watch by reading data, writing data, or disconnecting * the transport, as appropriate for the given condition. -- cgit