use connect timestamp instead of reconnect
This commit is contained in:
parent
04dc4526cc
commit
d9a149b4dd
@ -1647,8 +1647,8 @@ static void irc_close(struct link_any *l)
|
|||||||
|
|
||||||
server_next(LINK(is));
|
server_next(LINK(is));
|
||||||
server_cleanup(is);
|
server_cleanup(is);
|
||||||
if (LINK(is)->last_reconnection &&
|
if (LINK(is)->last_connection &&
|
||||||
time(NULL) - LINK(is)->last_reconnection
|
time(NULL) - LINK(is)->last_connection
|
||||||
< CONN_INTERVAL)
|
< CONN_INTERVAL)
|
||||||
timer = RECONN_TIMER;
|
timer = RECONN_TIMER;
|
||||||
mylog(LOG_ERROR, "%s dead, reconnecting in %d seconds",
|
mylog(LOG_ERROR, "%s dead, reconnecting in %d seconds",
|
||||||
@ -1955,6 +1955,7 @@ void irc_main(connection_t *inc, list_t *ll)
|
|||||||
if ((link = list_remove_first(&reconnectl))) {
|
if ((link = list_remove_first(&reconnectl))) {
|
||||||
conn = irc_server_connect(link);
|
conn = irc_server_connect(link);
|
||||||
list_add_last(&connl, conn);
|
list_add_last(&connl, conn);
|
||||||
|
link->last_connection = time(NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1972,7 +1973,6 @@ void irc_main(connection_t *inc, list_t *ll)
|
|||||||
if (l->recon_timer <= 0) {
|
if (l->recon_timer <= 0) {
|
||||||
list_it_remove(&li);
|
list_it_remove(&li);
|
||||||
list_add_last(&reconnectl, l);
|
list_add_last(&reconnectl, l);
|
||||||
l->last_reconnection = time(NULL);
|
|
||||||
} else {
|
} else {
|
||||||
l->recon_timer--;
|
l->recon_timer--;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user