mirror of
https://github.com/irssi/irssi.git
synced 2024-09-08 04:26:01 -04:00
/RECONNECT ALL - reconnects to all servers in reconnection queue
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1253 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
4550204783
commit
a191df786d
@ -293,6 +293,32 @@ static RECONNECT_REC *reconnect_find_tag(int tag)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void reconnect_all(void)
|
||||||
|
{
|
||||||
|
GSList *list;
|
||||||
|
SERVER_CONNECT_REC *conn;
|
||||||
|
RECONNECT_REC *rec;
|
||||||
|
|
||||||
|
/* first move reconnects to another list so if server_connect()
|
||||||
|
fails and goes to reconnection list again, we won't get stuck
|
||||||
|
here forever */
|
||||||
|
list = NULL;
|
||||||
|
while (reconnects != NULL) {
|
||||||
|
rec = reconnects->data;
|
||||||
|
|
||||||
|
list = g_slist_append(list, rec->conn);
|
||||||
|
server_reconnect_destroy(rec, FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
while (list != NULL) {
|
||||||
|
conn = list->data;
|
||||||
|
|
||||||
|
CHAT_PROTOCOL(conn)->server_connect(conn);
|
||||||
|
list = g_slist_remove(list, conn);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* SYNTAX: RECONNECT <tag> */
|
/* SYNTAX: RECONNECT <tag> */
|
||||||
static void cmd_reconnect(const char *data, SERVER_REC *server)
|
static void cmd_reconnect(const char *data, SERVER_REC *server)
|
||||||
{
|
{
|
||||||
@ -315,6 +341,12 @@ static void cmd_reconnect(const char *data, SERVER_REC *server)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (g_strcasecmp(data, "all") == 0) {
|
||||||
|
/* reconnect all servers in reconnect queue */
|
||||||
|
reconnect_all();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (*data == '\0') {
|
if (*data == '\0') {
|
||||||
/* reconnect to first server in reconnection list */
|
/* reconnect to first server in reconnection list */
|
||||||
if (reconnects == NULL)
|
if (reconnects == NULL)
|
||||||
|
Loading…
Reference in New Issue
Block a user