diff options
author | Will Thompson <will.thompson@collabora.co.uk> | 2012-11-02 11:55:53 +0000 |
---|---|---|
committer | Will Thompson <will.thompson@collabora.co.uk> | 2012-11-02 11:55:53 +0000 |
commit | c679fe4baaec1c29f7d0fbbed1f6b1d9c7d1266c (patch) | |
tree | 864547ab2b1f04cd5cad52d50333ee105e9c7eee | |
parent | f7766957dbb4ea80ac86d65b83f361b8c82aab45 (diff) | |
download | telepathy-idle-c679fe4baaec1c29f7d0fbbed1f6b1d9c7d1266c.tar.gz |
Clarify ping timeout comparison
Jonny wanted this to be clearer on
<https://bugs.freedesktop.org/show_bug.cgi?id=56589#c1>.
-rw-r--r-- | src/idle-connection.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/idle-connection.c b/src/idle-connection.c index 07adc92..29967c6 100644 --- a/src/idle-connection.c +++ b/src/idle-connection.c @@ -832,8 +832,9 @@ static gboolean keepalive_timeout_cb(gpointer user_data) { if (priv->ping_time != 0) { gint64 seconds_since_ping = (now - priv->ping_time) / G_USEC_PER_SEC; + gint64 grace_period = priv->keepalive_interval * MISSED_KEEPALIVES_BEFORE_DISCONNECTING; - if (seconds_since_ping > priv->keepalive_interval * MISSED_KEEPALIVES_BEFORE_DISCONNECTING) { + if (seconds_since_ping > grace_period) { IDLE_DEBUG("haven't heard from the server in %" G_GINT64_FORMAT " seconds " "(more than %u keepalive intervals)", seconds_since_ping, MISSED_KEEPALIVES_BEFORE_DISCONNECTING); |