Fix sending CAP END twice when SASL is not used

When SASL is not used, we should only send CAP END after we send a CAP
REQ. Previously CAP END was sent both after a CAP REQ and a CAP ACK,
resulting in two CAP END messages.

Sending a CAP END right after the CAP REQ rather than waiting for the
CAP ACK/NAK saves 1 RTT.
This commit is contained in:
delthas 2020-05-21 07:03:13 +02:00 committed by Simon Ser
parent de7b4c8588
commit 566986fdd5
No known key found for this signature in database
GPG Key ID: 0FDE7BE0E88F5E48

View File

@ -398,13 +398,6 @@ func (uc *upstreamConn) handleMessage(msg *irc.Message) error {
}
}
if uc.saslClient == nil {
uc.SendMessage(&irc.Message{
Command: "CAP",
Params: []string{"END"},
})
}
if uc.registered {
uc.forEachDownstream(func(dc *downstreamConn) {
dc.updateSupportedCaps()