From 566986fdd561d5be187f86af998f380df12be107 Mon Sep 17 00:00:00 2001 From: delthas Date: Thu, 21 May 2020 07:03:13 +0200 Subject: [PATCH] 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. --- upstream.go | 7 ------- 1 file changed, 7 deletions(-) diff --git a/upstream.go b/upstream.go index e386379..efedbea 100644 --- a/upstream.go +++ b/upstream.go @@ -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()