Skip to content

Commit

Permalink
webrtc: wait for listener context before dropping connection (#2932)
Browse files Browse the repository at this point in the history
  • Loading branch information
sukunrt committed Aug 21, 2024
1 parent f535990 commit 412daa4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions p2p/transport/webrtc/listener.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ func (l *listener) listen() {
}

select {
case <-ctx.Done():
log.Warn("could not push connection: ctx done")
case <-l.ctx.Done():
log.Debug("dropping connection, listener closed")
conn.Close()
case l.acceptQueue <- conn:
// acceptQueue is an unbuffered channel, so this blocks until the connection is accepted.
Expand Down

0 comments on commit 412daa4

Please sign in to comment.