Remove `should_update_expected_server_connection_id_length_` from QuicDispatcher. Its value is always false, even in tests. PiperOrigin-RevId: 651400527
diff --git a/quiche/quic/core/quic_dispatcher.cc b/quiche/quic/core/quic_dispatcher.cc index 4c59fc5..4ced4aa 100644 --- a/quiche/quic/core/quic_dispatcher.cc +++ b/quiche/quic/core/quic_dispatcher.cc
@@ -238,7 +238,6 @@ expected_server_connection_id_length), clear_stateless_reset_addresses_alarm_(alarm_factory_->CreateAlarm( new ClearStatelessResetAddressesAlarm(this))), - should_update_expected_server_connection_id_length_(false), connection_id_generator_(connection_id_generator) { QUIC_BUG_IF(quic_bug_12724_1, GetSupportedVersions().empty()) << "Trying to create dispatcher without any supported versions"; @@ -290,7 +289,6 @@ } if (packet_info.destination_connection_id.length() != expected_server_connection_id_length_ && - !should_update_expected_server_connection_id_length_ && packet_info.version.IsKnown() && !packet_info.version.AllowsVariableLengthConnectionIds()) { SetLastError(QUIC_INVALID_PACKET_HEADER); @@ -317,14 +315,6 @@ } } - // Before introducing the flag, it was impossible for a short header to - // update |expected_server_connection_id_length_|. - if (should_update_expected_server_connection_id_length_ && - packet_info.version_flag) { - expected_server_connection_id_length_ = - packet_info.destination_connection_id.length(); - } - if (MaybeDispatchPacket(packet_info)) { // Packet has been dropped or successfully dispatched, stop processing. return;
diff --git a/quiche/quic/core/quic_dispatcher.h b/quiche/quic/core/quic_dispatcher.h index 625f519..b88cd0e 100644 --- a/quiche/quic/core/quic_dispatcher.h +++ b/quiche/quic/core/quic_dispatcher.h
@@ -314,14 +314,6 @@ virtual void RestorePerPacketContext( std::unique_ptr<QuicPerPacketContext> /*context*/) {} - // If true, our framer will change its expected connection ID length - // to the received destination connection ID length of all IETF long headers. - void SetShouldUpdateExpectedServerConnectionIdLength( - bool should_update_expected_server_connection_id_length) { - should_update_expected_server_connection_id_length_ = - should_update_expected_server_connection_id_length; - } - // Called if a packet from an unseen connection is reset or rejected. virtual void OnNewConnectionRejected() {} @@ -461,10 +453,9 @@ // IETF short headers contain a destination connection ID but do not // encode its length. This variable contains the length we expect to read. // This is also used to signal an error when a long header packet with - // different destination connection ID length is received when - // should_update_expected_server_connection_id_length_ is false and packet's + // different destination connection ID length is received when packet's // version does not allow variable length connection ID. - uint8_t expected_server_connection_id_length_; + const uint8_t expected_server_connection_id_length_; // Records client addresses that have been recently reset. absl::flat_hash_set<QuicSocketAddress, QuicSocketAddressHash> @@ -473,10 +464,6 @@ // An alarm which clear recent_stateless_reset_addresses_. std::unique_ptr<QuicAlarm> clear_stateless_reset_addresses_alarm_; - // If true, change expected_server_connection_id_length_ to be the received - // destination connection ID length of all IETF long headers. - bool should_update_expected_server_connection_id_length_; - ConnectionIdGeneratorInterface& connection_id_generator_; };