http3: reset stream if the server sends too many 1xx responses (#5144)

This commit is contained in:
Marten Seemann
2025-05-17 12:18:18 +08:00
committed by GitHub
parent 8ef0a71581
commit 06e8ee1bcf
2 changed files with 6 additions and 0 deletions

View File

@@ -412,6 +412,10 @@ func testClient1xxHandling(t *testing.T, numEarlyHints int, terminalStatus int,
str.EXPECT().Write(gomock.Any()).DoAndReturn(buf.Write).AnyTimes()
str.EXPECT().Close()
str.EXPECT().Read(gomock.Any()).DoAndReturn(bytes.NewReader(rspBytes).Read).AnyTimes()
if tooMany {
str.EXPECT().CancelRead(quic.StreamErrorCode(ErrCodeExcessiveLoad))
str.EXPECT().CancelWrite(quic.StreamErrorCode(ErrCodeExcessiveLoad))
}
conn.EXPECT().OpenStreamSync(gomock.Any()).Return(str, nil)
cc := (&Transport{}).NewClientConn(conn)