mirror of
https://github.com/irssi/irssi.git
synced 2026-08-21 01:22:26 +02:00
Connecting to IPv6 IRC server with IP address didn't work because the
USER command didn't like the ':' characters in server address.. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@523 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
271ebb5be7
commit
24b56c77ec
1 changed files with 9 additions and 2 deletions
|
|
@ -74,7 +74,7 @@ void irc_server_connect_free(IRC_SERVER_CONNECT_REC *rec)
|
||||||
static void server_init(IRC_SERVER_REC *server)
|
static void server_init(IRC_SERVER_REC *server)
|
||||||
{
|
{
|
||||||
IRC_SERVER_CONNECT_REC *conn;
|
IRC_SERVER_CONNECT_REC *conn;
|
||||||
char hostname[100];
|
char hostname[100], *address, *ptr;
|
||||||
|
|
||||||
g_return_if_fail(server != NULL);
|
g_return_if_fail(server != NULL);
|
||||||
|
|
||||||
|
|
@ -99,8 +99,15 @@ static void server_init(IRC_SERVER_REC *server)
|
||||||
if (gethostname(hostname, sizeof(hostname)) != 0 || *hostname == '\0')
|
if (gethostname(hostname, sizeof(hostname)) != 0 || *hostname == '\0')
|
||||||
strcpy(hostname, "xx");
|
strcpy(hostname, "xx");
|
||||||
|
|
||||||
|
address = server->connrec->address;
|
||||||
|
ptr = strrchr(address, ':');
|
||||||
|
if (ptr != NULL) {
|
||||||
|
/* IPv6 address .. doesn't work here, use the string after
|
||||||
|
the last : char */
|
||||||
|
address = ptr+1;
|
||||||
|
}
|
||||||
irc_send_cmdv(server, "USER %s %s %s :%s", conn->username, hostname,
|
irc_send_cmdv(server, "USER %s %s %s :%s", conn->username, hostname,
|
||||||
server->connrec->address, conn->realname);
|
address, conn->realname);
|
||||||
|
|
||||||
server->cmdcount = 0;
|
server->cmdcount = 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue