summaryrefslogtreecommitdiffstats
path: root/dbus
diff options
context:
space:
mode:
Diffstat (limited to 'dbus')
-rw-r--r--dbus/dbus-connection.c4
-rw-r--r--dbus/dbus-mainloop.c27
-rw-r--r--dbus/dbus-message.c7
-rw-r--r--dbus/dbus-transport.c2
4 files changed, 34 insertions, 6 deletions
diff --git a/dbus/dbus-connection.c b/dbus/dbus-connection.c
index 9843d288..59a0b28f 100644
--- a/dbus/dbus-connection.c
+++ b/dbus/dbus-connection.c
@@ -2103,6 +2103,10 @@ dbus_connection_get_dispatch_status (DBusConnection *connection)
* the current incoming message queue, runs any handlers for it, and
* unrefs the message. Returns a status indicating whether messages/data
* remain, more memory is needed, or all data has been processed.
+ *
+ * Even if the dispatch status is #DBUS_DISPATCH_DATA_REMAINS,
+ * does not necessarily dispatch a message, as the data may
+ * be part of authentication or the like.
*
* @param connection the connection
* @returns dispatch status
diff --git a/dbus/dbus-mainloop.c b/dbus/dbus-mainloop.c
index 60191882..43e0788d 100644
--- a/dbus/dbus-mainloop.c
+++ b/dbus/dbus-mainloop.c
@@ -483,8 +483,8 @@ _dbus_loop_queue_dispatch (DBusLoop *loop,
return FALSE;
}
-/* Returns TRUE if we have any timeouts or ready file descriptors,
- * which is just used in test code as a debug hack
+/* Returns TRUE if we invoked any timeouts or have ready file
+ * descriptors, which is just used in test code as a debug hack
*/
dbus_bool_t
@@ -634,13 +634,24 @@ _dbus_loop_iterate (DBusLoop *loop,
timeout = msecs_remaining;
else
timeout = MIN (msecs_remaining, timeout);
+
+#if MAINLOOP_SPEW
+ _dbus_verbose (" timeout added, %d remaining, aggregate timeout %d\n",
+ msecs_remaining, timeout);
+#endif
_dbus_assert (timeout >= 0);
if (timeout == 0)
break; /* it's not going to get shorter... */
}
-
+#if MAINLOOP_SPEW
+ else if (cb->type == CALLBACK_TIMEOUT)
+ {
+ _dbus_verbose (" skipping disabled timeout\n");
+ }
+#endif
+
link = next;
}
}
@@ -717,6 +728,12 @@ _dbus_loop_iterate (DBusLoop *loop,
#endif
}
}
+#if MAINLOOP_SPEW
+ else if (cb->type == CALLBACK_TIMEOUT)
+ {
+ _dbus_verbose (" skipping invocation of disabled timeout\n");
+ }
+#endif
link = next;
}
@@ -780,6 +797,10 @@ _dbus_loop_iterate (DBusLoop *loop,
}
next_iteration:
+#if MAINLOOP_SPEW
+ _dbus_verbose (" moving to next iteration\n");
+#endif
+
if (fds && fds != stack_fds)
dbus_free (fds);
if (watches_for_fds)
diff --git a/dbus/dbus-message.c b/dbus/dbus-message.c
index 29995fdd..efe26b9e 100644
--- a/dbus/dbus-message.c
+++ b/dbus/dbus-message.c
@@ -1024,8 +1024,11 @@ dbus_message_new_error_reply (DBusMessage *original_message,
sender = get_string_field (original_message,
FIELD_SENDER, NULL);
-
- _dbus_assert (sender != NULL);
+
+ /* sender may be NULL for non-message-bus case or
+ * when the message bus is dealing with an unregistered
+ * connection.
+ */
message = dbus_message_new (error_name, sender);
diff --git a/dbus/dbus-transport.c b/dbus/dbus-transport.c
index e580b08c..23322566 100644
--- a/dbus/dbus-transport.c
+++ b/dbus/dbus-transport.c
@@ -783,7 +783,7 @@ _dbus_transport_get_dispatch_status (DBusTransport *transport)
if (_dbus_auth_do_work (transport->auth) ==
DBUS_AUTH_STATE_WAITING_FOR_MEMORY)
return DBUS_DISPATCH_NEED_MEMORY;
- else
+ else if (!_dbus_transport_get_is_authenticated (transport))
return DBUS_DISPATCH_COMPLETE;
}