Skip to content

Commit 2df4c53

Browse files
neilddmitshur
authored andcommitted
[internal-branch.go1.16-vendor] http2: fix race in DATA frame padding refund
Move flow adjustment back under cc.mu. Updates golang/go#49076 Change-Id: Idb762091cfeb55c18bc74389e62193f81438624f Reviewed-on: https://go-review.googlesource.com/c/net/+/351950 Trust: Damien Neil <[email protected]> Run-TryBot: Damien Neil <[email protected]> Reviewed-by: Brad Fitzpatrick <[email protected]> Reviewed-on: https://go-review.googlesource.com/c/net/+/356983 Reviewed-by: Dmitri Shuralyov <[email protected]>
1 parent d7eefc9 commit 2df4c53

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

http2/transport.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2338,14 +2338,16 @@ func (rl *clientConnReadLoop) processData(f *DataFrame) error {
23382338
}
23392339
if refund > 0 {
23402340
cc.inflow.add(int32(refund))
2341+
if !didReset {
2342+
cs.inflow.add(int32(refund))
2343+
}
23412344
}
23422345
cc.mu.Unlock()
23432346

23442347
if refund > 0 {
23452348
cc.wmu.Lock()
23462349
cc.fr.WriteWindowUpdate(0, uint32(refund))
23472350
if !didReset {
2348-
cs.inflow.add(int32(refund))
23492351
cc.fr.WriteWindowUpdate(cs.ID, uint32(refund))
23502352
}
23512353
cc.bw.Flush()

0 commit comments

Comments
 (0)