Delete dead function: QuicConnection::SelectMutualVersion() PiperOrigin-RevId: 770673966
diff --git a/quiche/quic/core/quic_connection.cc b/quiche/quic/core/quic_connection.cc index 74ac6e4..a0bc854 100644 --- a/quiche/quic/core/quic_connection.cc +++ b/quiche/quic/core/quic_connection.cc
@@ -748,25 +748,6 @@ return sent_packet_manager_.ApplicationDrivenPacingRate(); } -bool QuicConnection::SelectMutualVersion( - const ParsedQuicVersionVector& available_versions) { - // Try to find the highest mutual version by iterating over supported - // versions, starting with the highest, and breaking out of the loop once we - // find a matching version in the provided available_versions vector. - const ParsedQuicVersionVector& supported_versions = - framer_.supported_versions(); - for (size_t i = 0; i < supported_versions.size(); ++i) { - const ParsedQuicVersion& version = supported_versions[i]; - if (std::find(available_versions.begin(), available_versions.end(), - version) != available_versions.end()) { - framer_.set_version(version); - return true; - } - } - - return false; -} - void QuicConnection::OnError(QuicFramer* framer) { // Packets that we can not or have not decrypted are dropped. // TODO(rch): add stats to measure this.
diff --git a/quiche/quic/core/quic_connection.h b/quiche/quic/core/quic_connection.h index 29cc1c5..c70ce1c 100644 --- a/quiche/quic/core/quic_connection.h +++ b/quiche/quic/core/quic_connection.h
@@ -1525,11 +1525,6 @@ // change. virtual QuicSocketAddress GetEffectivePeerAddressFromCurrentPacket() const; - // Selects and updates the version of the protocol being used by selecting a - // version from |available_versions| which is also supported. Returns true if - // such a version exists, false otherwise. - bool SelectMutualVersion(const ParsedQuicVersionVector& available_versions); - // Returns the current per-packet options for the connection. PerPacketOptions* per_packet_options() { return per_packet_options_; }
diff --git a/quiche/quic/core/quic_connection_test.cc b/quiche/quic/core/quic_connection_test.cc index 38a6389..c28a3c7 100644 --- a/quiche/quic/core/quic_connection_test.cc +++ b/quiche/quic/core/quic_connection_test.cc
@@ -532,7 +532,6 @@ using QuicConnection::active_effective_peer_migration_type; using QuicConnection::IsCurrentPacketConnectivityProbing; - using QuicConnection::SelectMutualVersion; using QuicConnection::set_defer_send_in_response_to_packets; protected: @@ -7049,32 +7048,6 @@ IsError(QUIC_PEER_GOING_AWAY)); } -TEST_P(QuicConnectionTest, SelectMutualVersion) { - connection_.SetSupportedVersions(AllSupportedVersions()); - // Set the connection to speak the lowest quic version. - connection_.set_version(QuicVersionMin()); - EXPECT_EQ(QuicVersionMin(), connection_.version()); - - // Pass in available versions which includes a higher mutually supported - // version. The higher mutually supported version should be selected. - ParsedQuicVersionVector supported_versions = AllSupportedVersions(); - EXPECT_TRUE(connection_.SelectMutualVersion(supported_versions)); - EXPECT_EQ(QuicVersionMax(), connection_.version()); - - // Expect that the lowest version is selected. - // Ensure the lowest supported version is less than the max, unless they're - // the same. - ParsedQuicVersionVector lowest_version_vector; - lowest_version_vector.push_back(QuicVersionMin()); - EXPECT_TRUE(connection_.SelectMutualVersion(lowest_version_vector)); - EXPECT_EQ(QuicVersionMin(), connection_.version()); - - // Shouldn't be able to find a mutually supported version. - ParsedQuicVersionVector unsupported_version; - unsupported_version.push_back(UnsupportedQuicVersion()); - EXPECT_FALSE(connection_.SelectMutualVersion(unsupported_version)); -} - TEST_P(QuicConnectionTest, ConnectionCloseWhenWritable) { EXPECT_FALSE(writer_->IsWriteBlocked());