From e72c896bb4115c80a68c63bed8469c642ad8cec2 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Tue, 8 Feb 2022 16:38:34 +0100 Subject: [PATCH] Add context to upstreamConn.register --- upstream.go | 4 +--- user.go | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/upstream.go b/upstream.go index 5899ce6..c8f272b 100644 --- a/upstream.go +++ b/upstream.go @@ -1916,9 +1916,7 @@ func splitSpace(s string) []string { }) } -func (uc *upstreamConn) register() { - ctx := context.TODO() - +func (uc *upstreamConn) register(ctx context.Context) { uc.nick = GetNick(&uc.user.User, &uc.network.Network) uc.nickCM = uc.network.casemap(uc.nick) uc.username = GetUsername(&uc.user.User, &uc.network.Network) diff --git a/user.go b/user.go index 9530e0f..fefe654 100644 --- a/user.go +++ b/user.go @@ -220,7 +220,7 @@ func (net *network) run() { net.user.srv.Identd.Store(uc.RemoteAddr().String(), uc.LocalAddr().String(), userIdent(&net.user.User)) } - uc.register() + uc.register(context.TODO()) if err := uc.runUntilRegistered(context.TODO()); err != nil { text := err.Error() temp := true