summaryrefslogtreecommitdiff
path: root/src/gui/curses/gui-input.c
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2004-12-27 16:22:39 +0000
committerSebastien Helleu <flashcode@flashtux.org>2004-12-27 16:22:39 +0000
commitf4f2ec3668624b8cf29b9dab734f9069d90a8fec (patch)
tree1559d5284d4d839044759bbafc7f5a4b60c62d55 /src/gui/curses/gui-input.c
parent486e55be0255d22a2530068d2a684273003c944e (diff)
downloadweechat-f4f2ec3668624b8cf29b9dab734f9069d90a8fec.zip
auto-reconnection to server (new options: server_autoreconnect (on/off), server_autoreconnect_delay (in seconds)), disconnections are now managed without problem by WeeChat
Diffstat (limited to 'src/gui/curses/gui-input.c')
-rw-r--r--src/gui/curses/gui-input.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/gui/curses/gui-input.c b/src/gui/curses/gui-input.c
index dfa245b6d..6c805742b 100644
--- a/src/gui/curses/gui-input.c
+++ b/src/gui/curses/gui-input.c
@@ -627,8 +627,14 @@ gui_main_loop ()
for (ptr_server = irc_servers; ptr_server;
ptr_server = ptr_server->next_server)
{
- if (ptr_server->sock4 >= 0)
- FD_SET (ptr_server->sock4, &read_fd);
+ /* check if reconnection is pending */
+ if ((!ptr_server->is_connected)
+ && (ptr_server->reconnect_start > 0)
+ && (new_time >= (ptr_server->reconnect_start + ptr_server->autoreconnect_delay)))
+ server_reconnect (ptr_server);
+ else
+ if (ptr_server->sock4 >= 0)
+ FD_SET (ptr_server->sock4, &read_fd);
}
if (select (FD_SETSIZE, &read_fd, NULL, NULL, &timeout))
{