summaryrefslogtreecommitdiff
path: root/bus/services.c
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@codefactory.se>2003-03-16 22:25:18 +0000
committerAnders Carlsson <andersca@codefactory.se>2003-03-16 22:25:18 +0000
commit3f4086f0fdd1cc7fc03585ec9f750897fb3c1d55 (patch)
treea180077e4b5a97e83b0afc08619b2fb5db790f22 /bus/services.c
parentd1f65c6c4f9dd9750f9ad3eda5b590a4ffca6498 (diff)
downloaddbus-3f4086f0fdd1cc7fc03585ec9f750897fb3c1d55.tar.gz
2003-03-16 Anders Carlsson <andersca@codefactory.se>
* bus/activation.c: (bus_pending_activation_entry_free), (bus_pending_activation_free), (bus_activation_new), (bus_activation_unref), (bus_activation_service_created), (bus_activation_activate_service): * bus/activation.h: * bus/bus.c: (bus_context_new): * bus/desktop-file.c: (new_section): * bus/driver.c: (bus_driver_send_service_deleted), (bus_driver_handle_activate_service): * bus/services.c: (bus_registry_new), (bus_registry_ensure): * bus/services.h: * dbus/dbus-connection.c: (dbus_connection_send_with_reply_and_block): * dbus/dbus-message.c: (dbus_message_append_args_valist): * dbus/dbus-protocol.h: Make activation work better. Now pending activations will be queued and the daemon won't try to activate services that are already registered.
Diffstat (limited to 'bus/services.c')
-rw-r--r--bus/services.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/bus/services.c b/bus/services.c
index 92f6cdf4..821cb4af 100644
--- a/bus/services.c
+++ b/bus/services.c
@@ -29,6 +29,7 @@
#include "services.h"
#include "connection.h"
#include "utils.h"
+#include "activation.h"
struct BusService
{
@@ -42,13 +43,15 @@ struct BusService
struct BusRegistry
{
int refcount;
+
+ BusContext *context;
DBusHashTable *service_hash;
DBusMemPool *service_pool;
};
BusRegistry*
-bus_registry_new (void)
+bus_registry_new (BusContext *context)
{
BusRegistry *registry;
@@ -57,7 +60,8 @@ bus_registry_new (void)
return NULL;
registry->refcount = 1;
-
+ registry->context = context;
+
registry->service_hash = _dbus_hash_table_new (DBUS_HASH_STRING,
NULL, NULL);
if (registry->service_hash == NULL)
@@ -158,6 +162,14 @@ bus_registry_ensure (BusRegistry *registry,
return NULL;
}
+ if (!bus_activation_service_created (bus_context_get_activation (registry->context),
+ service->name, error))
+ {
+ dbus_free (service->name);
+ _dbus_mem_pool_dealloc (registry->service_pool, service);
+ return NULL;
+ }
+
if (!bus_service_add_owner (service, owner_if_created,
transaction, error))
{