mirror of
https://github.com/irssi/irssi.git
synced 2024-12-04 14:46:39 -05:00
Never reconnect immediately to server when server is being disconnected -
this could lead scripts (or maybe even irssi itself) handle the partially disconnected server wrong. Also moved the server->disconnected = TRUE before the "server disconnected" signal is sent, this makes sure the server_disconnect() is never called twice. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2339 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
0157d234f8
commit
92eaf0dc9a
@ -115,13 +115,7 @@ static void sserver_connect(SERVER_SETUP_REC *rec, SERVER_CONNECT_REC *conn)
|
||||
if (conn->port == 0) conn->port = rec->port;
|
||||
|
||||
server_setup_fill_reconn(conn, rec);
|
||||
if (rec->last_connect > time(NULL)-reconnect_time) {
|
||||
/* can't reconnect this fast, wait.. */
|
||||
server_reconnect_add(conn, rec->last_connect+reconnect_time);
|
||||
} else {
|
||||
/* connect to server.. */
|
||||
CHAT_PROTOCOL(conn)->server_connect(conn);
|
||||
}
|
||||
server_connect_unref(conn);
|
||||
}
|
||||
|
||||
@ -224,16 +218,8 @@ static void sig_reconnect(SERVER_REC *server)
|
||||
conn->port = server->connrec->port;
|
||||
conn->password = g_strdup(server->connrec->password);
|
||||
|
||||
if (server->connect_time != 0 &&
|
||||
time(NULL)-server->connect_time > reconnect_time) {
|
||||
/* there's been enough time since last connection,
|
||||
reconnect back immediately */
|
||||
CHAT_PROTOCOL(conn)->server_connect(conn);
|
||||
} else {
|
||||
/* reconnect later.. */
|
||||
server_reconnect_add(conn, (server->connect_time == 0 ? time(NULL) :
|
||||
server->connect_time) + reconnect_time);
|
||||
}
|
||||
server_connect_unref(conn);
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user