Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 350aad2

Browse filesBrowse files
committed
quic: correctly extend peer's flow control window after MAX_DATA
When sending the peer a connection-level flow control update in a MAX_DATA frame, we weren't recording the updated limit locally. When the peer wrote data past the old limit, we would incorrectly close the connection with a FLOW_CONTROL_ERROR. For golang/go#58547 Change-Id: I6879c0cccc3cfdc673b613a07b038138d9e285ff Reviewed-on: https://go-review.googlesource.com/c/net/+/530075 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Jonathan Amsterdam <jba@google.com>
1 parent 21814e7 commit 350aad2
Copy full SHA for 350aad2

File tree

Expand file treeCollapse file tree

2 files changed

+11
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+11
-0
lines changed
Open diff view settings
Collapse file

‎internal/quic/conn_flow.go‎

Copy file name to clipboardExpand all lines: internal/quic/conn_flow.go
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ func (c *Conn) appendMaxDataFrame(w *packetWriter, pnum packetNumber, pto bool)
106106
if !w.appendMaxDataFrame(c.streams.inflow.newLimit) {
107107
return false
108108
}
109+
c.streams.inflow.sentLimit += c.streams.inflow.newLimit
109110
c.streams.inflow.sent.setSent(pnum)
110111
}
111112
return true
Collapse file

‎internal/quic/conn_flow_test.go‎

Copy file name to clipboardExpand all lines: internal/quic/conn_flow_test.go
+10Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,16 @@ func TestConnInflowReturnOnRead(t *testing.T) {
3535
packetType1RTT, debugFrameMaxData{
3636
max: 128,
3737
})
38+
// Peer can write up to the new limit.
39+
tc.writeFrames(packetType1RTT, debugFrameStream{
40+
id: s.id,
41+
off: 64,
42+
data: make([]byte, 64),
43+
})
44+
tc.wantIdle("connection is idle")
45+
if n, err := s.ReadContext(ctx, make([]byte, 64)); n != 64 || err != nil {
46+
t.Fatalf("offset 64: s.Read() = %v, %v; want %v, nil", n, err, 64)
47+
}
3848
}
3949

4050
func TestConnInflowReturnOnRacingReads(t *testing.T) {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.