1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-27 05:16:38 +02:00

Add detection of system clock skew, reinitialize all timers when this happens

This commit is contained in:
Sebastien Helleu
2008-11-03 17:04:49 +01:00
parent fcd08f8ee4
commit 12bc7f13e1
11 changed files with 176 additions and 63 deletions
+10
View File
@@ -1117,6 +1117,11 @@ irc_server_outqueue_send (struct t_irc_server *server)
if (server->outqueue)
{
time_now = time (NULL);
/* detect if system clock has been changed (now lower than before) */
if (server->last_user_message > time_now)
server->last_user_message = time_now;
if (time_now >= server->last_user_message +
weechat_config_integer (irc_config_network_anti_flood))
{
@@ -1347,6 +1352,11 @@ irc_server_send_one_msg (struct t_irc_server *server, const char *message)
/* anti-flood: look whether we should queue outgoing message or not */
time_now = time (NULL);
/* detect if system clock has been changed (now lower than before) */
if (server->last_user_message > time_now)
server->last_user_message = time_now;
queue = 0;
if ((server->queue_msg)
&& ((server->outqueue)