From dbc4c0ca13fcc1cdf2be6c35a4559bc456243acb Mon Sep 17 00:00:00 2001 From: Anders Carlsson Date: Sat, 1 Feb 2003 21:26:32 +0000 Subject: 2003-02-01 Anders Carlsson * bus/driver.c: (create_unique_client_name), (bus_driver_handle_hello): Don't take a name, just use a numeric id to identify each client. * dbus/Makefile.am: * dbus/dbus-bus.c: (dbus_bus_register_client), (dbus_bus_acquire_service), (dbus_bus_service_exists): * dbus/dbus-bus.h: Add new convenience functions for communicating with the bus. * dbus/dbus-message.h: * dbus/dbus-protocol.h: Fix a typo. --- bus/driver.c | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) (limited to 'bus/driver.c') diff --git a/bus/driver.c b/bus/driver.c index ea13a9e6..426db3f1 100644 --- a/bus/driver.c +++ b/bus/driver.c @@ -105,8 +105,7 @@ bus_driver_send_service_acquired (DBusConnection *connection, } static dbus_bool_t -create_unique_client_name (const char *name, - DBusString *str) +create_unique_client_name (DBusString *str) { /* We never want to use the same unique client name twice, because * we want to guarantee that if you send a message to a given unique @@ -118,9 +117,6 @@ create_unique_client_name (const char *name, static int next_minor_number = 0; int len; - if (!_dbus_string_append (str, name)) - return FALSE; - len = _dbus_string_get_length (str); while (TRUE) @@ -170,27 +166,11 @@ static void bus_driver_handle_hello (DBusConnection *connection, DBusMessage *message) { - DBusResultCode result; - char *name; DBusString unique_name; BusService *service; - _DBUS_HANDLE_OOM ((result = dbus_message_get_fields (message, - DBUS_TYPE_STRING, &name, - 0)) != DBUS_RESULT_NO_MEMORY); - - if (result != DBUS_RESULT_SUCCESS) - { - dbus_free (name); - dbus_connection_disconnect (connection); - return; - } - _DBUS_HANDLE_OOM (_dbus_string_init (&unique_name, _DBUS_INT_MAX)); - - _DBUS_HANDLE_OOM (create_unique_client_name (name, &unique_name)); - - dbus_free (name); + _DBUS_HANDLE_OOM (create_unique_client_name (&unique_name)); /* Create the service */ _DBUS_HANDLE_OOM (service = bus_service_lookup (&unique_name, TRUE)); -- cgit