Fix reconnect interval reset and timeout logging and add header

This commit is contained in:
Alex D. 2021-01-03 16:47:11 +00:00
parent 312e729eaf
commit bde12cdec2
Signed by: caskd
GPG Key ID: F92BA85F61F4C173
1 changed files with 3 additions and 1 deletions

View File

@ -33,6 +33,7 @@
#include <string.h> // strerror()
#include <sys/types.h> // time_t size_t
#include <unistd.h> // getopt() chdir() close()
#include <time.h> // time()
#define UIRC_IRCV3
#define UIRC_HELPERS
@ -275,8 +276,9 @@ main(int argc, char* argv[])
continue;
}
} else if (connection.info.state == CONN_ACTIVE) {
connection.info.reconinter = 0;
if (connection.data.timeout > 0 && connection.info.l_message < ctime - connection.data.timeout) {
LOG(LOG_WARN, "Timed out because no message was received since %lu.", connection.data.timeout);
LOG(LOG_WARN, "Timed out because no message was received since %lu.", connection.info.l_message);
connection.info.state = CONN_RECONNECTING;
continue;
}