Remove notion of static stream in QuicStreamIdManager.
QuicStreamId manager now doesn't keep track of the number of static stream QuicSession has. Instead, when an application of QuicSession sends out its config for max allowed incoming stream, it should add the number of expected static streams.
This allows creation of static streams later in a QuicSession.
gfe-relnote: v99 only, not protected.
PiperOrigin-RevId: 265728450
Change-Id: I3c9ed20f7d439fc9feb3b7f867e8b70c713c33ae
diff --git a/quic/core/quic_stream_id_manager.h b/quic/core/quic_stream_id_manager.h
index d0b0824..baba5ac 100644
--- a/quic/core/quic_stream_id_manager.h
+++ b/quic/core/quic_stream_id_manager.h
@@ -47,12 +47,10 @@
", outgoing_max_streams_: ", outgoing_max_streams_,
", next_outgoing_stream_id_: ", next_outgoing_stream_id_,
", outgoing_stream_count_: ", outgoing_stream_count_,
- ", outgoing_static_stream_count_: ", outgoing_static_stream_count_,
", using_default_max_streams_: ", using_default_max_streams_,
", incoming_actual_max_streams_: ", incoming_actual_max_streams_,
", incoming_advertised_max_streams_: ",
incoming_advertised_max_streams_,
- ", incoming_static_stream_count_: ", incoming_static_stream_count_,
", incoming_stream_count_: ", incoming_stream_count_,
", available_streams_.size(): ", available_streams_.size(),
", largest_peer_created_stream_id_: ", largest_peer_created_stream_id_,
@@ -88,37 +86,14 @@
// allocates a stream ID past the peer specified limit.
QuicStreamId GetNextOutgoingStreamId();
- // Set the outgoing stream limits to be |max_open_streams| plus the number
- // of static streams that have been opened. For outgoing and incoming,
- // respectively.
- // SetMaxOpenOutgoingStreams will QUIC_BUG if it is called after
- // a MAX_STREAMS frame has been received.
- // TODO(fkastenholz): When static streams disappear, these should be removed.
- void SetMaxOpenOutgoingStreams(size_t max_open_streams);
void SetMaxOpenIncomingStreams(size_t max_open_streams);
- // Adjust the outgoing stream limit - max_open_streams is the limit, not
- // including static streams. Does not QUIC_BUG if it is called _after_
- // receiving a MAX_STREAMS.
- void AdjustMaxOpenOutgoingStreams(size_t max_open_streams);
-
// Sets the maximum number of outgoing streams to max_open_streams.
// Used when configuration has been done and we have an initial
// maximum stream count from the peer. Note that if the stream count is such
// that it would result in stream ID values that are greater than the
// implementation limit, it pegs the count at the implementation limit.
- bool ConfigureMaxOpenOutgoingStreams(size_t max_open_streams);
-
- // Register a new stream as a static stream. This is used so that the
- // advertised MAX STREAMS can be calculated based on the start of the
- // dynamic stream space. This method will take any stream ID, one that either
- // this node or the peer will initiate.
- // If |stream_already_counted| is true, the stream is already counted as an
- // open stream else where, so no need to count it again.
- // Returns false if this fails because the new static stream would cause the
- // stream limit to be exceeded.
- bool RegisterStaticStream(QuicStreamId stream_id,
- bool stream_already_counted);
+ bool SetMaxOpenOutgoingStreams(size_t max_open_streams);
// Checks if the incoming stream ID exceeds the MAX_STREAMS limit. If the
// limit is exceeded, closes the connection and returns false. Uses the
@@ -134,10 +109,6 @@
// Return true if given stream is peer initiated.
bool IsIncomingStream(QuicStreamId id) const;
- size_t outgoing_static_stream_count() const {
- return outgoing_static_stream_count_;
- }
-
size_t incoming_initial_max_open_streams() const {
return incoming_initial_max_open_streams_;
}
@@ -203,8 +174,6 @@
bool unidirectional_;
// This is the number of streams that this node can initiate.
- // This limit applies to both static and dynamic streams - the total
- // of the two can not exceed this count.
// This limit is:
// - Initiated to a value specified in the constructor
// - May be updated when the config is received.
@@ -219,11 +188,6 @@
// outgoing_max_streams_.
QuicStreamCount outgoing_stream_count_;
- // Number of outgoing static streams created.
- // TODO(fkastenholz): Remove when static streams no longer supported for IETF
- // QUIC.
- QuicStreamCount outgoing_static_stream_count_;
-
// Set to true while the default (from the constructor) outgoing stream limit
// is in use. It is set to false when either a MAX STREAMS frame is received
// or the transport negotiation completes and sets the stream limit (this is
@@ -232,12 +196,7 @@
// until we receive an authoritative value from the peer.
// outgoing_max_streams_ is initialized in the constructor
// to some hard-coded value, which may or may not be consistent
- // with what the peer wants. Furthermore, as we create outgoing
- // static streams, the cap raises as static streams get inserted
- // "beneath" the dynamic streams because, prior to receiving
- // a MAX_STREAMS, the values setting the limit are interpreted
- // as "number of request/responses" that can be created. Once
- // a MAX_STREAMS is received, it becomes a hard limit.
+ // with what the peer wants.
bool using_default_max_streams_;
// FOR INCOMING STREAMS
@@ -249,11 +208,6 @@
// Initial maximum on the number of open streams allowed.
QuicStreamCount incoming_initial_max_open_streams_;
- // Number of outgoing static streams created.
- // TODO(fkastenholz): Remove when static streams no longer supported for IETF
- // QUIC.
- QuicStreamCount incoming_static_stream_count_;
-
// This is the number of streams that have been created -- some are still
// open, the others have been closed. It is the number that is compared
// against MAX_STREAMS when deciding whether to accept a new stream or not.