irssi / irssi

The client of the future
https://irssi.org
Other
2.89k stars 356 forks source link

fails to connect to an INSPIRCD 4.0.1. server #1531

Open fezie opened 3 months ago

fezie commented 3 months ago

Irssi can't connect to an INSPIRCD 4.0.1 server:


19:19 -!- Irssi: Connecting to localhost [127.0.0.1] port 6667
19:19 Waiting for CAP LS response...
19:19 -!- Irssi: Connection to localhost established
19:19 !irc.example.com *** Looking up your hostname...
19:19 -!- JOIN Not enough parameters.
19:19 !irc.example.com *** Found your hostname (localhost)
19:19 -!- ERROR Closing link: (671AAAAAC@localhost) [Connection timeout]
19:19 -!- Irssi: Connection lost to localhost

rawlog shows:

<< CAP LS 302
<< JOIN :
>> :irc.example.com NOTICE * :*** Looking up your hostname...
>> :irc.example.com 461 * JOIN :Not enough parameters.
>> :irc.example.com NOTICE * :*** Found your hostname (localhost)

irc-servers.c has this:

        if (!conn->no_cap) {
                signal_emit("server waiting cap ls", 2, server, CAP_LS_VERSION);
                irc_send_cmd_now(server, "CAP LS " CAP_LS_VERSION);
                /* to detect non-CAP servers, send this bogus join */
                /* the : will make INSPIRCD respond with 451 instead of 461, too */
                irc_send_cmd_now(server, "JOIN :");
        }

But as you can see above it does return 461 and not 451

SadieCat commented 2 months ago

If you really need to do this hack you should probably use something like PING that can't be used before connection registration rather than relying on undefined behaviour with malformed trailing parameters. Regardless, I've added a workaround which will be released in InspIRCd 4.3.0 on Saturday.