summaryrefslogtreecommitdiffstats
path: root/dbus/dbus-transport-unix.c
diff options
context:
space:
mode:
authorOlivier Andrieu <oliv__a@users.sourceforge.net>2004-07-29 08:00:45 +0000
committerOlivier Andrieu <oliv__a@users.sourceforge.net>2004-07-29 08:00:45 +0000
commit4076d31c71bee332c4a697597a93345b45850b33 (patch)
treeb9526969be83df9ddd5ae4f9584410d0ffecf643 /dbus/dbus-transport-unix.c
parentb72fe8c67d724d0f4637714a72e4e91c9487349f (diff)
* bus/config-loader-libxml.c: complete the implementation of libxml
backend for config file loader. Doesn't work with full OOM test yet. * configure.in: change error when selecting libxml into a warning. * test/data/invalid-config-files: add two non-well-formed XML files. * glib/Makefile.am: libdbus_gtool always uses expat, not libxml. * dbus/dbus-transport-unix.c (unix_handle_watch): do not disconnect in case of DBUS_WATCH_HANGUP, several do_reading() may be necessary to read all the buffer. (bug #894) * bus/activation.c (bus_activation_activate_service): fix a potential assertion failure (bug #896). Small optimization in the case of auto-activation messages. * dbus/dbus-message.c (verify_test_message, _dbus_message_test): add test case for byte-through-vararg bug (#901). patch by Kimmo Hämäläinen.
Diffstat (limited to 'dbus/dbus-transport-unix.c')
-rw-r--r--dbus/dbus-transport-unix.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/dbus/dbus-transport-unix.c b/dbus/dbus-transport-unix.c
index 2e942abc..37825f1c 100644
--- a/dbus/dbus-transport-unix.c
+++ b/dbus/dbus-transport-unix.c
@@ -717,11 +717,25 @@ unix_handle_watch (DBusTransport *transport,
_dbus_assert (watch == unix_transport->read_watch ||
watch == unix_transport->write_watch);
+ /* Disconnect in case of an error. In case of hangup do not
+ * disconnect the transport because data can still be in the buffer
+ * and do_reading may need several iteration to read it all (because
+ * of its max_bytes_read_per_iteration limit). The condition where
+ * flags == HANGUP (without READABLE) probably never happen in fact.
+ */
+ if ((flags & DBUS_WATCH_ERROR) ||
+ ((flags & DBUS_WATCH_HANGUP) && !(flags & DBUS_WATCH_READABLE)))
+ {
+ _dbus_verbose ("Hang up or error on watch\n");
+ _dbus_transport_disconnect (transport);
+ return TRUE;
+ }
+
if (watch == unix_transport->read_watch &&
(flags & DBUS_WATCH_READABLE))
{
-#if 1
- _dbus_verbose ("handling read watch\n");
+#if 0
+ _dbus_verbose ("handling read watch (%x)\n", flags);
#endif
if (!do_authentication (transport, TRUE, FALSE))
return FALSE;
@@ -763,12 +777,6 @@ unix_handle_watch (DBusTransport *transport,
}
#endif /* DBUS_ENABLE_VERBOSE_MODE */
- if (flags & (DBUS_WATCH_HANGUP | DBUS_WATCH_ERROR))
- {
- _dbus_transport_disconnect (transport);
- return TRUE;
- }
-
return TRUE;
}