summaryrefslogtreecommitdiffstats
path: root/dbus
diff options
context:
space:
mode:
authorHavoc Pennington <hp@redhat.com>2003-05-16 20:09:25 +0000
committerHavoc Pennington <hp@redhat.com>2003-05-16 20:09:25 +0000
commit306eab3e3d998472ad111146a12b7697ea96c9b9 (patch)
tree613b5918113060fb66b7122307d8a6d2c2c2344f /dbus
parentce53bbd7af4488b8374aeccc2e80fb2f7eff0683 (diff)
2003-05-16 Havoc Pennington <hp@redhat.com>
* dbus/dbus-connection.c: disable verbose lock spew * tools/dbus-send.c: add --print-reply command line option * tools/dbus-print-message.h (print_message): new util function shared by dbus-send and dbus-monitor * tools/dbus-monitor.c (handler_func): exit on disconnect * dbus/dbus-transport-unix.c (do_reading): if the transport is disconnected, don't try to use the read_watch * dbus/dbus-watch.c (dbus_watch_get_enabled): assert watch != NULL so we can find this bug more easily
Diffstat (limited to 'dbus')
-rw-r--r--dbus/dbus-connection.c2
-rw-r--r--dbus/dbus-transport-unix.c10
-rw-r--r--dbus/dbus-watch.c1
3 files changed, 9 insertions, 4 deletions
diff --git a/dbus/dbus-connection.c b/dbus/dbus-connection.c
index 9da5fb52..d877a0b4 100644
--- a/dbus/dbus-connection.c
+++ b/dbus/dbus-connection.c
@@ -36,7 +36,7 @@
#include "dbus-protocol.h"
#include "dbus-dataslot.h"
-#if 1
+#if 0
#define CONNECTION_LOCK(connection) do { \
_dbus_verbose (" LOCK: %s\n", _DBUS_FUNCTION_NAME); \
dbus_mutex_lock ((connection)->mutex); \
diff --git a/dbus/dbus-transport-unix.c b/dbus/dbus-transport-unix.c
index fbf334e4..5df1c461 100644
--- a/dbus/dbus-transport-unix.c
+++ b/dbus/dbus-transport-unix.c
@@ -593,11 +593,9 @@ do_reading (DBusTransport *transport)
total = 0;
again:
-
+
/* See if we've exceeded max messages and need to disable reading */
check_read_watch (transport);
- if (!dbus_watch_get_enabled (unix_transport->read_watch))
- return TRUE;
if (total > unix_transport->max_bytes_read_per_iteration)
{
@@ -606,9 +604,15 @@ do_reading (DBusTransport *transport)
goto out;
}
+ _dbus_assert (unix_transport->read_watch != NULL ||
+ transport->disconnected);
+
if (transport->disconnected)
goto out;
+ if (!dbus_watch_get_enabled (unix_transport->read_watch))
+ return TRUE;
+
if (_dbus_auth_needs_decoding (transport->auth))
{
if (_dbus_string_get_length (&unix_transport->encoded_incoming) > 0)
diff --git a/dbus/dbus-watch.c b/dbus/dbus-watch.c
index 55b182b2..5b59e8c8 100644
--- a/dbus/dbus-watch.c
+++ b/dbus/dbus-watch.c
@@ -535,6 +535,7 @@ dbus_watch_set_data (DBusWatch *watch,
dbus_bool_t
dbus_watch_get_enabled (DBusWatch *watch)
{
+ _dbus_assert (watch != NULL);
return watch->enabled;
}