diff options
author | Anders Carlsson <andersca@codefactory.se> | 2003-02-13 21:37:58 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@codefactory.se> | 2003-02-13 21:37:58 +0000 |
commit | 97ee8d189948c9f2c86464ca33f82e6daeaedc72 (patch) | |
tree | 2fd81b6957587fd7ba4480598aeebb337148d05e /bus | |
parent | aa4b4ef5955606659557a40a2220090ee9c108d4 (diff) |
2003-02-13 Anders Carlsson <andersca@codefactory.se>
* bus/driver.c: (bus_driver_handle_hello):
* bus/driver.h:
* bus/services.c: (bus_service_lookup):
Reorder message sending so we get a more sane order.
* test/bus-test.c: (message_handler):
Fix tyop.
Diffstat (limited to 'bus')
-rw-r--r-- | bus/driver.c | 17 | ||||
-rw-r--r-- | bus/driver.h | 1 | ||||
-rw-r--r-- | bus/services.c | 2 |
3 files changed, 10 insertions, 10 deletions
diff --git a/bus/driver.c b/bus/driver.c index 25d6d263..9983f573 100644 --- a/bus/driver.c +++ b/bus/driver.c @@ -52,7 +52,7 @@ bus_driver_send_service_deleted (const char *service_name) dbus_message_unref (message); } -static void +void bus_driver_send_service_created (const char *service_name) { DBusMessage *message; @@ -172,24 +172,21 @@ bus_driver_handle_hello (DBusConnection *connection, BUS_HANDLE_OOM (_dbus_string_init (&unique_name, _DBUS_INT_MAX)); BUS_HANDLE_OOM (create_unique_client_name (&unique_name)); + + BUS_HANDLE_OOM (bus_connection_set_name (connection, &unique_name)); + BUS_HANDLE_OOM (dbus_message_set_sender (message, + bus_connection_get_name (connection))); + BUS_HANDLE_OOM (bus_driver_send_welcome_message (connection, message)); + /* Create the service */ BUS_HANDLE_OOM (service = bus_service_lookup (&unique_name, TRUE)); bus_service_set_prohibit_replacement (service, TRUE); /* Add the connection as the owner */ BUS_HANDLE_OOM (bus_service_add_owner (service, connection)); - BUS_HANDLE_OOM (bus_connection_set_name (connection, &unique_name)); - BUS_HANDLE_OOM (dbus_message_set_sender (message, - bus_connection_get_name (connection))); - _dbus_string_free (&unique_name); - - BUS_HANDLE_OOM (bus_driver_send_welcome_message (connection, message)); - - /* Broadcast a service created message */ - bus_driver_send_service_created (bus_service_get_name (service)); } static void diff --git a/bus/driver.h b/bus/driver.h index fc4d2590..3019fe43 100644 --- a/bus/driver.h +++ b/bus/driver.h @@ -34,6 +34,7 @@ void bus_driver_send_service_lost (DBusConnection *connection, const char *service_name); void bus_driver_send_service_acquired (DBusConnection *connection, const char *service_name); +void bus_driver_send_service_created (const char *service_name); diff --git a/bus/services.c b/bus/services.c index 1c949559..497978d0 100644 --- a/bus/services.c +++ b/bus/services.c @@ -99,6 +99,8 @@ bus_service_lookup (const DBusString *service_name, return NULL; } + bus_driver_send_service_created (service->name); + return service; } |