summaryrefslogtreecommitdiffstats
path: root/bus
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@codefactory.se>2003-02-01 21:26:32 +0000
committerAnders Carlsson <andersca@codefactory.se>2003-02-01 21:26:32 +0000
commitdbc4c0ca13fcc1cdf2be6c35a4559bc456243acb (patch)
tree3305148cd8a347b25dd4ec1577cb02b616a033dd /bus
parentffeb3f0ee1bd083c4470a34988bd92f438b81e1e (diff)
2003-02-01 Anders Carlsson <andersca@codefactory.se>
* 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.
Diffstat (limited to 'bus')
-rw-r--r--bus/driver.c24
1 files changed, 2 insertions, 22 deletions
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));