upstream: fix missing WHOIS in abortPendingCommands

Fixes the following panic:

    2022/05/03 08:05:32 panic serving user "asdf": Unsupported pending command "WHOIS"
    goroutine 15 [running]:
    runtime/debug.Stack()
            /opt/go/src/runtime/debug/stack.go:24 +0x65
    git.sr.ht/~emersion/soju.(*Server).addUserLocked.func1.1()
            ~/soju/server.go:317 +0x5d
    panic({0xa18da0, 0x6815bf10})
            /opt/go/src/runtime/panic.go:838 +0x207
    git.sr.ht/~emersion/soju.(*upstreamConn).abortPendingCommands(0x6811c9c0)
            ~/soju/upstream.go:338 +0x953
    git.sr.ht/~emersion/soju.(*user).handleUpstreamDisconnected(0x680b7080, 0x6811c9c0)
            ~/soju/user.go:744 +0x6d
    git.sr.ht/~emersion/soju.(*user).updateNetwork(0x680b7080, {0xb99a00, 0x684690e0}, 0x681343c0)
            ~/soju/user.go:936 +0x387
    git.sr.ht/~emersion/soju.handleServiceNetworkUpdate({0xb99a00, 0x684690e0}, 0x68116000, {0x681b8a20?, 0x40429108?, 0x10?})
            ~/soju/service.go:590 +0x14f
    git.sr.ht/~emersion/soju.handleServicePRIVMSG({0xb99a00, 0x684690e0}, 0x68116000, {0x680af5d5?, 0x1?})
            ~/soju/service.go:146 +0x7df
    git.sr.ht/~emersion/soju.(*downstreamConn).handleMessageRegistered(0x68116000, {0xb99a00, 0x684690e0}, 0x681b8940)
            ~/soju/downstream.go:2503 +0x9e9e
    git.sr.ht/~emersion/soju.(*downstreamConn).handleMessage(0x68116000, {0xb999c8?, 0x680240a0?}, 0x681b8940)
            ~/soju/downstream.go:727 +0xde
    git.sr.ht/~emersion/soju.(*user).run(0x680b7080)
            ~/soju/user.go:690 +0xe05
    git.sr.ht/~emersion/soju.(*Server).addUserLocked.func1()
            ~/soju/server.go:327 +0x70
    created by git.sr.ht/~emersion/soju.(*Server).addUserLocked
            ~/soju/server.go:314 +0x178
This commit is contained in:
Simon Ser 2022-05-03 08:32:59 +02:00
parent 48ec515120
commit d321fcd9f0

View File

@ -322,6 +322,13 @@ func (uc *upstreamConn) abortPendingCommands() {
Command: irc.RPL_ENDOFWHO,
Params: []string{dc.nick, mask, "Command aborted"},
})
case "WHOIS":
nick := pendingCmd.msg.Params[len(pendingCmd.msg.Params)-1]
dc.SendMessage(&irc.Message{
Prefix: dc.srv.prefix(),
Command: irc.RPL_ENDOFWHOIS,
Params: []string{dc.nick, nick, "Command aborted"},
})
case "AUTHENTICATE":
dc.endSASL(&irc.Message{
Prefix: dc.srv.prefix(),