summaryrefslogtreecommitdiffstats
path: root/bus/connection.c
diff options
context:
space:
mode:
authorHavoc Pennington <hp@redhat.com>2003-10-11 06:20:28 +0000
committerHavoc Pennington <hp@redhat.com>2003-10-11 06:20:28 +0000
commit40751c847b18b4861f623fc83fc8742bc463363b (patch)
treef4875210529f3f957841f234f3316bc614c9fcba /bus/connection.c
parentc1f0e189030ceb2bafea0bc30d6b72a0fa381ddc (diff)
2003-10-11 Havoc Pennington <hp@pobox.com>
* 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)
Diffstat (limited to 'bus/connection.c')
-rw-r--r--bus/connection.c26
1 files changed, 6 insertions, 20 deletions
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 <dbus/dbus-list.h>
#include <dbus/dbus-hash.h>
#include <dbus/dbus-timeout.h>
@@ -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