Pass maximum table capacity and max blocked streams in QpackDecoder constructor.
These two limits are set by the decoder using SETTINGS_QPACK_MAX_TABLE_CAPACITY
and SETTINGS_QPACK_BLOCKED_STREAMS, therefore they can be decided by
QuicSpdyStream or higher layers by the time QpackDecoder is constructed.
Therefore the constructor seems the most appropriate place to communicate these
to QpackDecoder.
(This is in contrast with the value of these settings in the encoder, which
are received via SETTINGS from the peer after QpackEncoder is instantiated.)
gfe-relnote: n/a, change to QUIC v99-only code. Protected by existing disabled gfe2_reloadable_flag_quic_enable_version_99.
PiperOrigin-RevId: 261601336
Change-Id: I1449b63e67e387714a3bc30b6488571277281475
diff --git a/quic/core/qpack/qpack_decoder_test.cc b/quic/core/qpack/qpack_decoder_test.cc
index af3a6a2..4b57456 100644
--- a/quic/core/qpack/qpack_decoder_test.cc
+++ b/quic/core/qpack/qpack_decoder_test.cc
@@ -26,14 +26,18 @@
// Header Acknowledgement decoder stream instruction with stream_id = 1.
const char* const kHeaderAcknowledgement = "\x81";
+// TODO(b/112770235) Change this constant, enforce the limit and add tests.
+const uint64_t kMaximumBlockedStreams = 0;
+
class QpackDecoderTest : public QuicTestWithParam<FragmentMode> {
protected:
QpackDecoderTest()
- : qpack_decoder_(&encoder_stream_error_delegate_,
- &decoder_stream_sender_delegate_),
- fragment_mode_(GetParam()) {
- qpack_decoder_.SetMaximumDynamicTableCapacity(1024);
- }
+ : qpack_decoder_(
+ /* maximum_dynamic_table_capacity = */ 1024,
+ kMaximumBlockedStreams,
+ &encoder_stream_error_delegate_,
+ &decoder_stream_sender_delegate_),
+ fragment_mode_(GetParam()) {}
~QpackDecoderTest() override = default;
@@ -566,7 +570,7 @@
DecodeEncoderStreamData(QuicTextUtils::HexDecode("3fe10f"));
}
-TEST_P(QpackDecoderTest, SetMaximumDynamicTableCapacity) {
+TEST_P(QpackDecoderTest, SetDynamicTableCapacity) {
// Update dynamic table capacity to 128, which does not exceed the maximum.
DecodeEncoderStreamData(QuicTextUtils::HexDecode("3f61"));
}