diff options
author | Diogo Sousa <diogogsousa@gmail.com> | 2014-01-27 19:57:41 +0000 |
---|---|---|
committer | Diogo Sousa <diogogsousa@gmail.com> | 2014-01-27 19:57:41 +0000 |
commit | 1d6d737927d4e99333a8e6ae26b44ca959fc1cd9 (patch) | |
tree | 4a9304d9c6589e879bb0f7d326c48ef1f1298c6b | |
parent | efcb850956b3c9bf4896217ffb3df8266dbab686 (diff) |
Fixed lag meter getting stuck.
Also lag_sent in struct server should have always been an unsigned long. Fixes #749.
-rw-r--r-- | src/common/hexchat.c | 10 | ||||
-rw-r--r-- | src/common/hexchat.h | 2 |
2 files changed, 8 insertions, 4 deletions
diff --git a/src/common/hexchat.c b/src/common/hexchat.c index d44fa2f4..07f91cfb 100644 --- a/src/common/hexchat.c +++ b/src/common/hexchat.c @@ -286,12 +286,16 @@ lag_check (void) NULL, NULL, 0); if (prefs.hex_net_auto_reconnect) serv->auto_reconnect (serv, FALSE, -1); - } else if (!serv->lag_sent) + } else { snprintf (tbuf, sizeof (tbuf), "LAG%lu", tim); serv->p_ping (serv, "", tbuf); - serv->lag_sent = tim; - fe_set_lag (serv, -1); + + if (!serv->lag_sent) + { + serv->lag_sent = tim; + fe_set_lag (serv, -1); + } } } list = list->next; diff --git a/src/common/hexchat.h b/src/common/hexchat.h index 63d0fbed..39a44191 100644 --- a/src/common/hexchat.h +++ b/src/common/hexchat.h @@ -570,7 +570,7 @@ typedef struct server time_t msg_last_time; /*time_t connect_time;*/ /* when did it connect? */ - time_t lag_sent; + unsigned long lag_sent; /* we are still waiting for this ping response*/ time_t ping_recv; /* when we last got a ping reply */ time_t away_time; /* when we were marked away */ |