From f468907fb09e8198c4cce7e8f2ddeae8b5476b9e Mon Sep 17 00:00:00 2001 From: Havoc Pennington Date: Fri, 14 Mar 2003 05:17:19 +0000 Subject: 2003-03-14 Havoc Pennington * bus/loop.c (bus_loop_iterate): add this so we can "run loop until no work remains" in test code. (the large diff here is just code movement, no actual changes) * dbus/dbus-server-debug.c (DEFAULT_INTERVAL): change interval to 1, no point waiting around for test code. (_dbus_server_debug_accept_transport): unref the timeout after adding it (right?) * dbus/dbus-transport-debug.c (DEFAULT_INTERVAL): ditto --- dbus/dbus-connection.c | 4 +++- dbus/dbus-server-debug.c | 4 +++- dbus/dbus-server.c | 2 +- dbus/dbus-transport-debug.c | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) (limited to 'dbus') diff --git a/dbus/dbus-connection.c b/dbus/dbus-connection.c index 19fe717d..d52341a7 100644 --- a/dbus/dbus-connection.c +++ b/dbus/dbus-connection.c @@ -334,6 +334,7 @@ _dbus_connection_remove_watch (DBusConnection *connection, * available. Otherwise records the timeout to be added when said * function is available. Also re-adds the timeout if the * DBusAddTimeoutFunction changes. May fail due to lack of memory. + * The timeout will fire only one time. * * @param connection the connection. * @param timeout the timeout to add. @@ -1861,7 +1862,8 @@ dbus_connection_set_watch_functions (DBusConnection *connection, * dbus_timeout_get_interval. * * Once a timeout occurs, dbus_timeout_handle should be called to invoke - * the timeout's callback. + * the timeout's callback, and the timeout should be automatically + * removed. i.e. timeouts are one-shot. * * @param connection the connection. * @param add_function function to add a timeout. diff --git a/dbus/dbus-server-debug.c b/dbus/dbus-server-debug.c index f558e82e..5f79e81c 100644 --- a/dbus/dbus-server-debug.c +++ b/dbus/dbus-server-debug.c @@ -43,7 +43,7 @@ /** * Default timeout interval when reading or writing. */ -#define DEFAULT_INTERVAL 10 +#define DEFAULT_INTERVAL 1 /** * Opaque object representing a debug server implementation. @@ -249,6 +249,8 @@ _dbus_server_debug_accept_transport (DBusServer *server, if (!_dbus_server_add_timeout (server, timeout)) goto failed; + _dbus_timeout_unref (timeout); + return TRUE; failed: diff --git a/dbus/dbus-server.c b/dbus/dbus-server.c index 99a5a2af..cfcc0dd5 100644 --- a/dbus/dbus-server.c +++ b/dbus/dbus-server.c @@ -146,7 +146,7 @@ _dbus_server_remove_watch (DBusServer *server, /** * Adds a timeout for this server, chaining out to application-provided - * timeout handlers. + * timeout handlers. The timeout will fire only one time. * * @param server the server. * @param timeout the timeout to add. diff --git a/dbus/dbus-transport-debug.c b/dbus/dbus-transport-debug.c index e0a90644..cb4b3c2c 100644 --- a/dbus/dbus-transport-debug.c +++ b/dbus/dbus-transport-debug.c @@ -44,7 +44,7 @@ /** * Default timeout interval when reading or writing. */ -#define DEFAULT_INTERVAL 10 +#define DEFAULT_INTERVAL 1 /** * Opaque object representing a debug transport. -- cgit