summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2002-01-22 21:04:04 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2002-01-22 21:04:04 +0000
commit92eaf0dc9a198d92115d306554b3ddbfe18b7c97 (patch)
tree4bb943ccb303d4909bf702f6be83821211fbec48 /src/core
parent0157d234f87337f51bb6e3fb285eb89dc44ac5ac (diff)
downloadirssi-92eaf0dc9a198d92115d306554b3ddbfe18b7c97.zip
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
Diffstat (limited to 'src/core')
-rw-r--r--src/core/servers-reconnect.c20
1 files changed, 3 insertions, 17 deletions
diff --git a/src/core/servers-reconnect.c b/src/core/servers-reconnect.c
index 429ffc43..e51a3fa2 100644
--- a/src/core/servers-reconnect.c
+++ b/src/core/servers-reconnect.c
@@ -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_reconnect_add(conn, rec->last_connect+reconnect_time);
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_reconnect_add(conn, (server->connect_time == 0 ? time(NULL) :
+ server->connect_time) + reconnect_time);
server_connect_unref(conn);
return;
}