Make sure QPACK stream types are sent along with SETTINGS in one packet.
gfe-relnote: v99 only, not protected.
Merge intruction: I wrote https://chromium-review.googlesource.com/c/chromium/src/+/1764346 to modify TestPakcetMaker so that v99 tests can be run again.
PiperOrigin-RevId: 264867694
Change-Id: I4d2453abb2f608d39f705c268ff7da265c69e22f
diff --git a/quic/core/qpack/qpack_send_stream.cc b/quic/core/qpack/qpack_send_stream.cc
index b978985..50fe687 100644
--- a/quic/core/qpack/qpack_send_stream.cc
+++ b/quic/core/qpack/qpack_send_stream.cc
@@ -25,11 +25,11 @@
void QpackSendStream::WriteStreamData(QuicStringPiece data) {
QuicConnection::ScopedPacketFlusher flusher(session()->connection());
- SendStreamType();
+ MaybeSendStreamType();
WriteOrBufferData(data, false, nullptr);
}
-void QpackSendStream::SendStreamType() {
+void QpackSendStream::MaybeSendStreamType() {
if (!stream_type_sent_) {
char type[sizeof(http3_stream_type_)];
QuicDataWriter writer(QUIC_ARRAYSIZE(type), type);
diff --git a/quic/core/qpack/qpack_send_stream.h b/quic/core/qpack/qpack_send_stream.h
index e7e4be3..09c6020 100644
--- a/quic/core/qpack/qpack_send_stream.h
+++ b/quic/core/qpack/qpack_send_stream.h
@@ -44,7 +44,7 @@
// TODO(b/112770235): Remove this method once QuicStreamIdManager supports
// creating HTTP/3 unidirectional streams dynamically.
- void SendStreamType();
+ void MaybeSendStreamType();
private:
const uint64_t http3_stream_type_;
diff --git a/quic/core/qpack/qpack_send_stream_test.cc b/quic/core/qpack/qpack_send_stream_test.cc
index 5f82024..c297b56 100644
--- a/quic/core/qpack/qpack_send_stream_test.cc
+++ b/quic/core/qpack/qpack_send_stream_test.cc
@@ -96,7 +96,7 @@
EXPECT_CALL(session_, WritevData(_, _, data.length(), _, _));
qpack_send_stream_->WriteStreamData(QuicStringPiece(data));
EXPECT_CALL(session_, WritevData(_, _, _, _, _)).Times(0);
- qpack_send_stream_->SendStreamType();
+ qpack_send_stream_->MaybeSendStreamType();
}
TEST_P(QpackSendStreamTest, ResetQpackStream) {