Send Set Dynamic Table Capacity instruction.
Do not change dynamic table capacity in
QpackHeaderTable::SetMaximumDynamicTableCapacity(), because according to
https://quicwg.org/base-drafts/draft-ietf-quic-qpack.html#eviction, "The initial
capacity of the dynamic table is zero.". Instead, add
QpackEncoder::SetDynamicTableCapacity() to send Set Dynamic Table Capacity
instruction.
Roundtrip tests were passing because QpackHeaderTable::SetMaximumDynamicTableCapacity() incorrectly updated the capacity for both the encoder and decoder context.
gfe-relnote: n/a, change to QUIC v99-only code. Protected by existing disabled gfe2_reloadable_flag_quic_enable_version_99.
PiperOrigin-RevId: 266358801
Change-Id: I23f10f224139dee79e9305c42c85b75cba61a999
diff --git a/quic/core/http/quic_spdy_stream_test.cc b/quic/core/http/quic_spdy_stream_test.cc
index 3798461..e09cbf4 100644
--- a/quic/core/http/quic_spdy_stream_test.cc
+++ b/quic/core/http/quic_spdy_stream_test.cc
@@ -1921,6 +1921,7 @@
testing::InSequence s;
Initialize(kShouldProcessData);
+ session_->qpack_decoder()->OnSetDynamicTableCapacity(1024);
auto decoder_send_stream =
QuicSpdySessionPeer::GetQpackDecoderSendStream(session_.get());
@@ -1983,6 +1984,7 @@
testing::InSequence s;
Initialize(kShouldProcessData);
+ session_->qpack_decoder()->OnSetDynamicTableCapacity(1024);
// HEADERS frame referencing first dynamic table entry.
std::string headers = HeadersFrame(QuicTextUtils::HexDecode("020080"));
@@ -2040,6 +2042,7 @@
}
Initialize(kShouldProcessData);
+ session_->qpack_decoder()->OnSetDynamicTableCapacity(1024);
// HEADERS frame only referencing entry with absolute index 0 but with
// Required Insert Count = 2, which is incorrect.
@@ -2078,6 +2081,7 @@
testing::InSequence s;
Initialize(kShouldProcessData);
+ session_->qpack_decoder()->OnSetDynamicTableCapacity(1024);
// HEADERS frame referencing first dynamic table entry.
std::string headers = HeadersFrame(QuicTextUtils::HexDecode("020080"));