1
0
mirror of https://github.com/irssi/irssi.git synced 2024-09-29 04:45:57 -04:00

Using different ports in one server for different chat networks didn't work

properly.


git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1580 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2001-06-27 21:47:31 +00:00 committed by cras
parent 5cb945cedf
commit 53975363ce
4 changed files with 12 additions and 7 deletions

View File

@ -197,7 +197,8 @@ static void sig_reconnect(SERVER_REC *server)
}
sserver = server_setup_find(server->connrec->address,
server->connrec->port);
server->connrec->port,
server->connrec->chatnet);
if (sserver != NULL) {
/* save the last connection time/status */

View File

@ -200,7 +200,7 @@ create_addr_conn(int chat_type, const char *address, int port,
g_return_val_if_fail(address != NULL, NULL);
sserver = server_setup_find(address, port);
sserver = server_setup_find(address, port, chatnet);
if (sserver != NULL) {
if (chat_type < 0)
chat_type = sserver->chat_type;
@ -303,7 +303,8 @@ server_create_conn(int chat_type, const char *dest, int port,
/* Find matching server from setup. Try to find record with a same port,
but fallback to any server with the same address. */
SERVER_SETUP_REC *server_setup_find(const char *address, int port)
SERVER_SETUP_REC *server_setup_find(const char *address, int port,
const char *chatnet)
{
SERVER_SETUP_REC *server;
GSList *tmp;
@ -314,7 +315,9 @@ SERVER_SETUP_REC *server_setup_find(const char *address, int port)
for (tmp = setupservers; tmp != NULL; tmp = tmp->next) {
SERVER_SETUP_REC *rec = tmp->data;
if (g_strcasecmp(rec->address, address) == 0) {
if (g_strcasecmp(rec->address, address) == 0 &&
(chatnet == NULL || rec->chatnet == NULL ||
g_strcasecmp(rec->chatnet, chatnet) == 0)) {
server = rec;
if (rec->port == port)
break;
@ -329,7 +332,7 @@ SERVER_SETUP_REC *server_setup_find_port(const char *address, int port)
{
SERVER_SETUP_REC *rec;
rec = server_setup_find(address, port);
rec = server_setup_find(address, port, NULL);
return rec == NULL || rec->port != port ? NULL : rec;
}

View File

@ -33,7 +33,8 @@ server_create_conn(int chat_type, const char *dest, int port,
/* Find matching server from setup. Try to find record with a same port,
but fallback to any server with the same address. */
SERVER_SETUP_REC *server_setup_find(const char *address, int port);
SERVER_SETUP_REC *server_setup_find(const char *address, int port,
const char *chatnet);
/* Find matching server from setup. Ports must match or NULL is returned. */
SERVER_SETUP_REC *server_setup_find_port(const char *address, int port);

View File

@ -175,7 +175,7 @@ static void cmd_server_remove(const char *data)
if (*addr == '\0') cmd_param_error(CMDERR_NOT_ENOUGH_PARAMS);
if (*port == '\0')
rec = server_setup_find(addr, -1);
rec = server_setup_find(addr, -1, NULL);
else
rec = server_setup_find_port(addr, atoi(port));