Skip to content

Commit 73d82ef

Browse files
committed
quic: handle DATA_BLOCKED frames
We never send DATA_BLOCKED frames, and ignore ones sent by the peer, but we do need to parse them. For golang/go#58547 Change-Id: Ic9893245108fd1c32067d14811e2d44488ce1ab5 Reviewed-on: https://go-review.googlesource.com/c/net/+/532715 LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Jonathan Amsterdam <[email protected]>
1 parent 5d5a036 commit 73d82ef

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

internal/quic/conn_recv.go

+5
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,11 @@ func (c *Conn) handleFrames(now time.Time, ptype packetType, space numberSpace,
254254
return
255255
}
256256
n = c.handleMaxStreamsFrame(now, payload)
257+
case frameTypeDataBlocked:
258+
if !frameOK(c, ptype, __01) {
259+
return
260+
}
261+
_, n = consumeDataBlockedFrame(payload)
257262
case frameTypeStreamsBlockedBidi, frameTypeStreamsBlockedUni:
258263
if !frameOK(c, ptype, __01) {
259264
return

internal/quic/stream_test.go

+17
Original file line numberDiff line numberDiff line change
@@ -1217,6 +1217,23 @@ func TestStreamPeerStopSendingForActiveStream(t *testing.T) {
12171217
})
12181218
}
12191219

1220+
func TestStreamReceiveDataBlocked(t *testing.T) {
1221+
tc := newTestConn(t, serverSide, permissiveTransportParameters)
1222+
tc.handshake()
1223+
tc.ignoreFrame(frameTypeAck)
1224+
1225+
// We don't do anything with these frames,
1226+
// but should accept them if the peer sends one.
1227+
tc.writeFrames(packetType1RTT, debugFrameStreamDataBlocked{
1228+
id: newStreamID(clientSide, bidiStream, 0),
1229+
max: 100,
1230+
})
1231+
tc.writeFrames(packetType1RTT, debugFrameDataBlocked{
1232+
max: 100,
1233+
})
1234+
tc.wantIdle("no response to STREAM_DATA_BLOCKED and DATA_BLOCKED")
1235+
}
1236+
12201237
type streamSide string
12211238

12221239
const (

0 commit comments

Comments
 (0)