downstream: use fresh context to send timeout errors
Using an expired context will never actually send the error message here.
This commit is contained in:
parent
6729297159
commit
e9678cee2f
@ -1690,6 +1690,9 @@ func (dc *downstreamConn) runUntilRegistered() error {
|
||||
go func() {
|
||||
<-ctx.Done()
|
||||
if err := ctx.Err(); err == context.DeadlineExceeded {
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 3*time.Second)
|
||||
defer cancel()
|
||||
|
||||
dc.SendMessage(ctx, &irc.Message{
|
||||
Prefix: dc.srv.prefix(),
|
||||
Command: "ERROR",
|
||||
|
Loading…
Reference in New Issue
Block a user