mirror of
https://github.com/irssi/irssi.git
synced 2024-12-04 14:46:39 -05:00
fix reconnect of multiplexed proxy
This commit is contained in:
parent
6933134352
commit
4a3a064d55
@ -27,6 +27,7 @@
|
|||||||
#include <irssi/src/core/misc.h>
|
#include <irssi/src/core/misc.h>
|
||||||
|
|
||||||
#include <irssi/src/irc/core/irc.h>
|
#include <irssi/src/irc/core/irc.h>
|
||||||
|
#include <irssi/src/irc/core/irc-chatnets.h>
|
||||||
#include <irssi/src/irc/core/irc-channels.h>
|
#include <irssi/src/irc/core/irc-channels.h>
|
||||||
|
|
||||||
#include <irssi/src/fe-common/core/printtext.h> /* FIXME: evil. need to do fe-proxy */
|
#include <irssi/src/fe-common/core/printtext.h> /* FIXME: evil. need to do fe-proxy */
|
||||||
@ -176,7 +177,7 @@ static void handle_client_connect_cmd(CLIENT_REC *client,
|
|||||||
if (!client->multiplex) {
|
if (!client->multiplex) {
|
||||||
args_pass = args;
|
args_pass = args;
|
||||||
} else {
|
} else {
|
||||||
IRC_SERVER_REC *server;
|
IRC_CHATNET_REC *chatnet;
|
||||||
char *tag;
|
char *tag;
|
||||||
const char *tag_end;
|
const char *tag_end;
|
||||||
|
|
||||||
@ -188,18 +189,19 @@ static void handle_client_connect_cmd(CLIENT_REC *client,
|
|||||||
}
|
}
|
||||||
|
|
||||||
tag = g_strndup(args, tag_end - args);
|
tag = g_strndup(args, tag_end - args);
|
||||||
server = IRC_SERVER(server_find_chatnet(tag));
|
chatnet = IRC_CHATNET(chatnet_find(tag));
|
||||||
g_free(tag);
|
|
||||||
|
|
||||||
if (!server) {
|
if (!chatnet) {
|
||||||
/* an invalid network was specified */
|
/* an invalid network was specified */
|
||||||
remove_client(client);
|
remove_client(client);
|
||||||
|
g_free(tag);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
client->server = server;
|
client->server = IRC_SERVER(server_find_chatnet(tag));
|
||||||
g_free(client->proxy_address);
|
g_free(client->proxy_address);
|
||||||
client->proxy_address = g_strdup_printf("%.*s.proxy", (int)(tag_end - args), args);
|
client->proxy_address = g_strdup_printf("%s.proxy", tag);
|
||||||
|
g_free(tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (g_strcmp0(password, args_pass) != 0) {
|
if (g_strcmp0(password, args_pass) != 0) {
|
||||||
@ -578,7 +580,8 @@ static void event_connected(IRC_SERVER_REC *server)
|
|||||||
if (rec->connected && rec->server == NULL &&
|
if (rec->connected && rec->server == NULL &&
|
||||||
(g_strcmp0(rec->listen->ircnet, "*") == 0 ||
|
(g_strcmp0(rec->listen->ircnet, "*") == 0 ||
|
||||||
(chatnet != NULL &&
|
(chatnet != NULL &&
|
||||||
g_ascii_strcasecmp(chatnet, rec->listen->ircnet) == 0))) {
|
strstr(rec->proxy_address, chatnet) == rec->proxy_address &&
|
||||||
|
rec->proxy_address[strlen(chatnet)] == '.'))) {
|
||||||
proxy_outdata(rec, ":%s NOTICE %s :Connected to server\r\n",
|
proxy_outdata(rec, ":%s NOTICE %s :Connected to server\r\n",
|
||||||
rec->proxy_address, rec->nick);
|
rec->proxy_address, rec->nick);
|
||||||
rec->server = server;
|
rec->server = server;
|
||||||
|
Loading…
Reference in New Issue
Block a user