Prevent IETF QUIC Frame transmission prior to config
A number of IETF QUIC fames, including MAX_STREAMS and STREAMS_BLOCKED, should not be sent prior to having the session configured.
gfe-relnote: N/A IETF QUIC, protected via V99 flag.
PiperOrigin-RevId: 269611696
Change-Id: Ibed580f9bff8f716f3f78481022b5c929f5634ef
diff --git a/quic/core/quic_stream_id_manager.h b/quic/core/quic_stream_id_manager.h
index baba5ac..51524ba 100644
--- a/quic/core/quic_stream_id_manager.h
+++ b/quic/core/quic_stream_id_manager.h
@@ -149,6 +149,10 @@
QuicTransportVersion transport_version() const;
+ // Called when session has been configured. Causes the Stream ID manager to
+ // send out any pending MAX_STREAMS and STREAMS_BLOCKED frames.
+ void OnConfigNegotiated();
+
private:
friend class test::QuicSessionPeer;
friend class test::QuicStreamIdManagerPeer;
@@ -226,6 +230,13 @@
// max_streams_window_ is set to 1/2 of the initial number of incoming streams
// that are allowed (as set in the constructor).
QuicStreamId max_streams_window_;
+
+ // MAX_STREAMS and STREAMS_BLOCKED frames are not sent before the session has
+ // been configured. Instead, the relevant information is stored in
+ // |pending_max_streams_| and |pending_streams_blocked_| and sent when
+ // OnConfigNegotiated() is invoked.
+ bool pending_max_streams_;
+ QuicStreamId pending_streams_blocked_;
};
} // namespace quic