From 40751c847b18b4861f623fc83fc8742bc463363b Mon Sep 17 00:00:00 2001 From: Havoc Pennington Date: Sat, 11 Oct 2003 06:20:28 +0000 Subject: 2003-10-11 Havoc Pennington * dbus/dbus-message.c (_dbus_message_test): add more test coverage, but #if 0 for now since they uncover a bug not fixed yet; I think in re_align_field_recurse() (re_align_field_recurse): add FIXME about broken assertion * dbus/dbus-sysdeps.c (_dbus_sysdeps_test): add more test coverage * bus/connection.c: share a couple code bits with expirelist.c * bus/expirelist.h, bus/expirelist.c: implement a generic expire-items-after-N-seconds facility, was going to share between expiring connections and replies, decided not to use for expiring connections for now. * bus/connection.c: add tracking of expected replies * COPYING: include AFL 2.0 (still need to change all the file headers) --- bus/connection.c | 26 ++++++-------------------- 1 file changed, 6 insertions(+), 20 deletions(-) (limited to 'bus/connection.c') diff --git a/bus/connection.c b/bus/connection.c index a824576c..68e4158a 100644 --- a/bus/connection.c +++ b/bus/connection.c @@ -26,6 +26,7 @@ #include "services.h" #include "utils.h" #include "signals.h" +#include "expirelist.h" #include #include #include @@ -672,8 +673,9 @@ bus_connections_expire_incomplete (BusConnections *connections) _dbus_assert (d != NULL); - elapsed = ((double) tv_sec - (double) d->connection_tv_sec) * 1000.0 + - ((double) tv_usec - (double) d->connection_tv_usec) / 1000.0; + elapsed = ELAPSED_MILLISECONDS_SINCE (d->connection_tv_sec, + d->connection_tv_usec, + tv_sec, tv_usec); if (elapsed >= (double) auth_timeout) { @@ -693,25 +695,9 @@ bus_connections_expire_incomplete (BusConnections *connections) link = next; } } - - if (next_interval >= 0) - { - _dbus_timeout_set_interval (connections->expire_timeout, - next_interval); - _dbus_timeout_set_enabled (connections->expire_timeout, TRUE); - _dbus_verbose ("Enabled incomplete connections timeout with interval %d, %d incomplete connections\n", - next_interval, connections->n_incomplete); - } - else if (dbus_timeout_get_enabled (connections->expire_timeout)) - { - _dbus_timeout_set_enabled (connections->expire_timeout, FALSE); - - _dbus_verbose ("Disabled incomplete connections timeout, %d incomplete connections\n", - connections->n_incomplete); - } - else - _dbus_verbose ("No need to disable incomplete connections timeout\n"); + bus_expire_timeout_set_interval (connections->expire_timeout, + next_interval); } static dbus_bool_t -- cgit