summaryrefslogtreecommitdiffstats
path: root/bus/dispatch.c
diff options
context:
space:
mode:
authorHavoc Pennington <hp@redhat.com>2003-03-13 03:52:58 +0000
committerHavoc Pennington <hp@redhat.com>2003-03-13 03:52:58 +0000
commit6ecc14ffabcffb69aa938a67940db48272e05046 (patch)
tree76e4c12cdc5c0ef9b3a9fc4913afdfa1fac6478c /bus/dispatch.c
parent29560adcc79a259a0be3511c056ee7453aa26c04 (diff)
2003-03-12 Havoc Pennington <hp@pobox.com>
Throughout: purge global variables, introduce BusActivation, BusConnections, BusRegistry, etc. objects instead. * bus/bus.h, bus/bus.c: introduce BusContext as a global message bus object * test/Makefile.am (TEST_BINARIES): disable bus-test for now, going to redo this a bit differently I think
Diffstat (limited to 'bus/dispatch.c')
-rw-r--r--bus/dispatch.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/bus/dispatch.c b/bus/dispatch.c
index d9fe81ac..1d2ea1c2 100644
--- a/bus/dispatch.c
+++ b/bus/dispatch.c
@@ -24,7 +24,9 @@
#include "dispatch.h"
#include "connection.h"
#include "driver.h"
+#include "services.h"
#include "utils.h"
+#include "bus.h"
#include <dbus/dbus-internals.h>
#include <string.h>
@@ -63,14 +65,18 @@ bus_dispatch_broadcast_message (BusTransaction *transaction,
{
DBusError tmp_error;
SendMessageData d;
+ BusConnections *connections;
_dbus_assert (dbus_message_get_sender (message) != NULL);
+ connections = bus_transaction_get_connections (transaction);
+
dbus_error_init (&tmp_error);
d.message = message;
d.transaction = transaction;
d.error = &tmp_error;
- bus_connection_foreach (send_one_message, &d);
+
+ bus_connections_foreach (connections, send_one_message, &d);
if (dbus_error_is_set (&tmp_error))
{
@@ -145,9 +151,13 @@ bus_dispatch_message_handler (DBusMessageHandler *handler,
const char *sender, *service_name, *message_name;
DBusError error;
BusTransaction *transaction;
-
+ BusContext *context;
+
transaction = NULL;
dbus_error_init (&error);
+
+ context = bus_connection_get_context (connection);
+ _dbus_assert (context != NULL);
/* If we can't even allocate an OOM error, we just go to sleep
* until we can.
@@ -181,7 +191,7 @@ bus_dispatch_message_handler (DBusMessageHandler *handler,
_dbus_assert (service_name != NULL); /* this message is intended for bus routing */
/* Create our transaction */
- transaction = bus_transaction_new ();
+ transaction = bus_transaction_new (context);
if (transaction == NULL)
{
BUS_SET_OOM (&error);
@@ -224,9 +234,12 @@ bus_dispatch_message_handler (DBusMessageHandler *handler,
{
DBusString service_string;
BusService *service;
+ BusRegistry *registry;
+ registry = bus_connection_get_registry (connection);
+
_dbus_string_init_const (&service_string, service_name);
- service = bus_service_lookup (&service_string);
+ service = bus_registry_lookup (registry, &service_string);
if (service == NULL)
{