Compare commits
3 Commits
wip/sysinf
...
pr-1320
Author | SHA1 | Date | |
---|---|---|---|
ca2b4d498c | |||
085d9c368c | |||
fb422732f2 |
@ -257,35 +257,39 @@ lag_check (void)
|
||||
GSList *list = serv_list;
|
||||
unsigned long tim;
|
||||
char tbuf[128];
|
||||
time_t now = time (0);
|
||||
time_t lag;
|
||||
time_t now = time(NULL);
|
||||
|
||||
tim = make_ping_time ();
|
||||
|
||||
time_t ping_interval = 15;
|
||||
time_t ping_timeout = 30;
|
||||
|
||||
if (prefs.hex_net_ping_timeout != 0)
|
||||
{
|
||||
ping_timeout = prefs.hex_net_ping_timeout;
|
||||
ping_interval = ping_timeout/2;
|
||||
}
|
||||
|
||||
while (list)
|
||||
{
|
||||
serv = list->data;
|
||||
if (serv->connected && serv->end_of_motd)
|
||||
{
|
||||
lag = now - serv->ping_recv;
|
||||
if (prefs.hex_net_ping_timeout != 0 && lag > prefs.hex_net_ping_timeout && lag > 0)
|
||||
{
|
||||
sprintf (tbuf, "%" G_GINT64_FORMAT, (gint64) lag);
|
||||
EMIT_SIGNAL (XP_TE_PINGTIMEOUT, serv->server_session, tbuf, NULL,
|
||||
NULL, NULL, 0);
|
||||
if (prefs.hex_net_auto_reconnect)
|
||||
serv->auto_reconnect (serv, FALSE, -1);
|
||||
}
|
||||
else
|
||||
if(!serv->lag_sent && (now - serv->ping_recv) > ping_interval)
|
||||
{
|
||||
g_snprintf (tbuf, sizeof (tbuf), "LAG%lu", tim);
|
||||
serv->p_ping (serv, "", tbuf);
|
||||
|
||||
if (!serv->lag_sent)
|
||||
{
|
||||
serv->lag_sent = tim;
|
||||
fe_set_lag (serv, -1);
|
||||
}
|
||||
serv->lag_sent = tim;
|
||||
fe_set_lag (serv, -1);
|
||||
}
|
||||
|
||||
if (prefs.hex_net_ping_timeout != 0 && (now - serv->socket_recv) > ping_timeout)
|
||||
{
|
||||
sprintf (tbuf, "%" G_GINT64_FORMAT, (gint64) now - serv->socket_recv);
|
||||
EMIT_SIGNAL (XP_TE_PINGTIMEOUT, serv->server_session, tbuf, NULL,
|
||||
NULL, NULL, 0);
|
||||
if (prefs.hex_net_auto_reconnect)
|
||||
serv->auto_reconnect (serv, FALSE, -1);
|
||||
}
|
||||
}
|
||||
list = list->next;
|
||||
@ -366,10 +370,11 @@ hexchat_misc_checks (void) /* this gets called every 1/2 second */
|
||||
if (count % 2)
|
||||
dcc_check_timeouts (); /* every 1 second */
|
||||
|
||||
if (count >= 60) /* every 30 seconds */
|
||||
if (count % 2) /* every 1 second*/
|
||||
lag_check ();
|
||||
|
||||
if (count > 3600)
|
||||
{
|
||||
if (prefs.hex_gui_lagometer)
|
||||
lag_check ();
|
||||
count = 0;
|
||||
}
|
||||
|
||||
|
@ -530,6 +530,7 @@ typedef struct server
|
||||
/*time_t connect_time;*/ /* when did it connect? */
|
||||
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 socket_recv; /* when we last received something from the socket */
|
||||
time_t away_time; /* when we were marked away */
|
||||
|
||||
char *encoding;
|
||||
|
@ -313,6 +313,8 @@ server_read (GIOChannel *source, GIOCondition condition, server *serv)
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
serv->socket_recv = time (NULL);
|
||||
|
||||
i = 0;
|
||||
|
||||
|
@ -127,6 +127,9 @@ EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "external", "external", "{021EC1D0-FF67-4700-9AB2-EAABF1159C09}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libenchant_win8", "..\src\libenchant_win8\libenchant_win8.vcxproj", "{BF0EBC16-68AD-4CD1-864C-5B56836EBE2A}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{87554B59-006C-4D94-9714-897B27067BA3} = {87554B59-006C-4D94-9714-897B27067BA3}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
|
Reference in New Issue
Block a user