Add context to upstreamConn.register

This commit is contained in:
Simon Ser 2022-02-08 16:38:34 +01:00
parent 375ac53f74
commit e72c896bb4
2 changed files with 2 additions and 4 deletions

View File

@ -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)

View File

@ -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