Skip to content
This repository has been archived by the owner on May 26, 2022. It is now read-only.

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 1ad4d0f commit 9df78c4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions transport.go
Original file line number Diff line number Diff line change
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 9df78c4

Please sign in to comment.