diff options
author | Havoc Pennington <hp@redhat.com> | 2003-08-20 14:48:04 +0000 |
---|---|---|
committer | Havoc Pennington <hp@redhat.com> | 2003-08-20 14:48:04 +0000 |
commit | d0c588575e3e2911eacb098fac26f02d1010cbfd (patch) | |
tree | ae33b122f0e28611117ad1d8f90c2611c3f99041 /bus/dispatch.c | |
parent | 68a3c593b9e77b33614726363c7b6fd85d113021 (diff) |
2003-08-19 Havoc Pennington <hp@pobox.com>
* dbus/dbus-message.c (decode_string_field): support FIELD_SENDER
(dbus_message_is_error): fix this function
* bus/dbus-daemon-1.1: clarify logic on when <deny>/<allow> rules
match
* bus/policy.c (bus_client_policy_check_can_receive): fix code to
reflect clarified man page
(bus_client_policy_check_can_send): ditto
* bus/session.conf.in: fixup
* bus/system.conf.in: fixup
Diffstat (limited to 'bus/dispatch.c')
-rw-r--r-- | bus/dispatch.c | 41 |
1 files changed, 29 insertions, 12 deletions
diff --git a/bus/dispatch.c b/bus/dispatch.c index 8eda25000..16102aa06 100644 --- a/bus/dispatch.c +++ b/bus/dispatch.c @@ -418,11 +418,14 @@ pop_message_waiting_for_memory (DBusConnection *connection) } static void -warn_unexpected (DBusConnection *connection, - DBusMessage *message, - const char *expected) +warn_unexpected_real (DBusConnection *connection, + DBusMessage *message, + const char *expected, + const char *function, + int line) { - _dbus_warn ("Received message interface \"%s\" member \"%s\" error name \"%s\" on %p, expecting %s\n", + _dbus_warn ("%s:%d received message interface \"%s\" member \"%s\" error name \"%s\" on %p, expecting %s\n", + function, line, dbus_message_get_interface (message) ? dbus_message_get_interface (message) : "(unset)", dbus_message_get_member (message) ? @@ -433,6 +436,23 @@ warn_unexpected (DBusConnection *connection, expected); } +#define warn_unexpected(connection, message, expected) \ + warn_unexpected_real (connection, message, expected, _DBUS_FUNCTION_NAME, __LINE__) + +static void +verbose_message_received (DBusConnection *connection, + DBusMessage *message) +{ + _dbus_verbose ("Received message interface \"%s\" member \"%s\" error name \"%s\" on %p\n", + dbus_message_get_interface (message) ? + dbus_message_get_interface (message) : "(unset)", + dbus_message_get_member (message) ? + dbus_message_get_member (message) : "(unset)", + dbus_message_get_error_name (message) ? + dbus_message_get_error_name (message) : "(unset)", + connection); +} + typedef struct { const char *expected_service_name; @@ -748,8 +768,7 @@ check_hello_message (BusContext *context, goto out; } - _dbus_verbose ("Received message %p on %p\n", - message, connection); + verbose_message_received (connection, message); if (!dbus_message_has_sender (message, DBUS_SERVICE_ORG_FREEDESKTOP_DBUS)) { @@ -984,8 +1003,7 @@ check_nonexistent_service_activation (BusContext *context, goto out; } - _dbus_verbose ("Received message %p on %p\n", - message, connection); + verbose_message_received (connection, message); if (dbus_message_get_type (message) == DBUS_MESSAGE_TYPE_ERROR) { @@ -1542,8 +1560,8 @@ check_existent_service_activation (BusContext *context, goto out; } - _dbus_verbose ("Received message %p on %p after sending %s\n", - message, connection, "ActivateService"); + verbose_message_received (connection, message); + _dbus_verbose (" (after sending %s)\n", "ActivateService"); if (dbus_message_get_type (message) == DBUS_MESSAGE_TYPE_ERROR) { @@ -1748,8 +1766,7 @@ check_segfault_service_activation (BusContext *context, goto out; } - _dbus_verbose ("Received message %p on %p\n", - message, connection); + verbose_message_received (connection, message); if (dbus_message_get_type (message) == DBUS_MESSAGE_TYPE_ERROR) { |