Fixed lag meter getting stuck.

Also lag_sent in struct server should have always been an unsigned long.

Fixes #749.
This commit is contained in:
Diogo Sousa 2014-01-27 19:57:41 +00:00
parent efcb850956
commit 1d6d737927
2 changed files with 8 additions and 4 deletions

View File

@ -286,14 +286,18 @@ lag_check (void)
NULL, NULL, 0); NULL, NULL, 0);
if (prefs.hex_net_auto_reconnect) if (prefs.hex_net_auto_reconnect)
serv->auto_reconnect (serv, FALSE, -1); serv->auto_reconnect (serv, FALSE, -1);
} else if (!serv->lag_sent) } else
{ {
snprintf (tbuf, sizeof (tbuf), "LAG%lu", tim); snprintf (tbuf, sizeof (tbuf), "LAG%lu", tim);
serv->p_ping (serv, "", tbuf); serv->p_ping (serv, "", tbuf);
if (!serv->lag_sent)
{
serv->lag_sent = tim; serv->lag_sent = tim;
fe_set_lag (serv, -1); fe_set_lag (serv, -1);
} }
} }
}
list = list->next; list = list->next;
} }
} }

View File

@ -570,7 +570,7 @@ typedef struct server
time_t msg_last_time; time_t msg_last_time;
/*time_t connect_time;*/ /* when did it connect? */ /*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 ping_recv; /* when we last got a ping reply */
time_t away_time; /* when we were marked away */ time_t away_time; /* when we were marked away */