Skip to content

Commit

Permalink
Prevent data race in allowWindowIncrease (#259)
Browse files Browse the repository at this point in the history
  • Loading branch information
mudler committed Feb 7, 2022
1 parent a54e613 commit add734f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions p2p/transport/quic/transport.go
Expand Up @@ -381,7 +381,9 @@ func (t *transport) allowWindowIncrease(sess quic.Session, size uint64) bool {
// into our connections map (which we do right after dialing / accepting it),
// we have no way to account for that memory. This should be very rare.
// Block this attempt. The session can request more memory later.
t.connMx.Lock()
c, ok := t.conns[sess]
t.connMx.Unlock()
if !ok {
return false
}
Expand Down

0 comments on commit add734f

Please sign in to comment.