From de7d1f7784dd59567ad13ec794254d0f99c00c27 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Fri, 10 Dec 2021 12:28:16 +0100 Subject: [PATCH] Add context to upstreamConn.handleCapAck --- upstream.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/upstream.go b/upstream.go index ae30c2d..7d64e55 100644 --- a/upstream.go +++ b/upstream.go @@ -540,7 +540,7 @@ func (uc *upstreamConn) handleMessage(ctx context.Context, msg *irc.Message) err caps := strings.Fields(subParams[0]) for _, name := range caps { - if err := uc.handleCapAck(strings.ToLower(name), subCmd == "ACK"); err != nil { + if err := uc.handleCapAck(ctx, strings.ToLower(name), subCmd == "ACK"); err != nil { return err } } @@ -1872,7 +1872,7 @@ func (uc *upstreamConn) requestSASL() bool { return uc.supportsSASL(uc.network.SASL.Mechanism) } -func (uc *upstreamConn) handleCapAck(name string, ok bool) error { +func (uc *upstreamConn) handleCapAck(ctx context.Context, name string, ok bool) error { uc.caps[name] = ok switch name { @@ -1897,7 +1897,7 @@ func (uc *upstreamConn) handleCapAck(name string, ok bool) error { return fmt.Errorf("unsupported SASL mechanism %q", name) } - uc.SendMessage(context.TODO(), &irc.Message{ + uc.SendMessage(ctx, &irc.Message{ Command: "AUTHENTICATE", Params: []string{auth.Mechanism}, })