In HTTP/3, write Priority on control stream before writing headers.
Currently the priority is in gQUIC fashion, where we only use the weight to build priority queue.
Priority might be sent on the control stream before handshake is confirmed. So this CL modifies QuicSendControlStream to send stream type and settings before any other data is sent.
gfe-relnote: v99 only, not in prod.
PiperOrigin-RevId: 256285943
Change-Id: Iaf72f9d6256a2692b284e3f6142755ff0d04d710
diff --git a/quic/core/http/quic_spdy_session.cc b/quic/core/http/quic_spdy_session.cc
index 3ef610e..0cd5f90 100644
--- a/quic/core/http/quic_spdy_session.cc
+++ b/quic/core/http/quic_spdy_session.cc
@@ -389,7 +389,8 @@
if (VersionHasStreamType(connection()->transport_version()) &&
eliminate_static_stream_map()) {
auto send_control = QuicMakeUnique<QuicSendControlStream>(
- GetNextOutgoingUnidirectionalStreamId(), this);
+ GetNextOutgoingUnidirectionalStreamId(), this,
+ max_inbound_header_list_size_);
send_control_stream_ = send_control.get();
RegisterStaticStreamNew(std::move(send_control),
/*stream_already_counted = */ false);
@@ -507,6 +508,14 @@
return frame.size();
}
+void QuicSpdySession::WriteH3Priority(const PriorityFrame& priority) {
+ DCHECK(VersionHasStreamType(connection()->transport_version()));
+ DCHECK(perspective() == Perspective::IS_CLIENT)
+ << "Server must not send priority";
+
+ send_control_stream_->WritePriority(priority);
+}
+
size_t QuicSpdySession::WritePushPromise(QuicStreamId original_stream_id,
QuicStreamId promised_stream_id,
SpdyHeaderBlock headers) {
@@ -529,9 +538,7 @@
void QuicSpdySession::SendMaxHeaderListSize(size_t value) {
if (VersionHasStreamType(connection()->transport_version())) {
- SettingsFrame settings;
- settings.values[kSettingsMaxHeaderListSize] = value;
- send_control_stream_->SendSettingsFrame(settings);
+ send_control_stream_->SendSettingsFrame();
return;
}
SpdySettingsIR settings_frame;