gfe-relnote: Remove pending_version_negotiation_packet_ from QuicConnection because it's only set to true in a method that's protected by checking whether it's already true. No functional change, not flag protected.
PiperOrigin-RevId: 330417867
Change-Id: Ie815bac5ab6725ef96a9ed3af171b2c9ff9b0d95
diff --git a/quic/core/quic_connection.cc b/quic/core/quic_connection.cc
index c0ec674..68ac758 100644
--- a/quic/core/quic_connection.cc
+++ b/quic/core/quic_connection.cc
@@ -247,9 +247,6 @@
should_last_packet_instigate_acks_(false),
max_undecryptable_packets_(0),
max_tracked_packets_(GetQuicFlag(FLAGS_quic_max_tracked_packet_count)),
- pending_version_negotiation_packet_(false),
- send_ietf_version_negotiation_packet_(false),
- send_version_negotiation_packet_with_prefixed_lengths_(false),
idle_timeout_connection_close_behavior_(
ConnectionCloseBehavior::SEND_CONNECTION_CLOSE_PACKET),
num_rtos_for_blackhole_detection_(0),
@@ -1930,47 +1927,6 @@
}
}
-void QuicConnection::SendVersionNegotiationPacket(bool ietf_quic,
- bool has_length_prefix) {
- pending_version_negotiation_packet_ = true;
- send_ietf_version_negotiation_packet_ = ietf_quic;
- send_version_negotiation_packet_with_prefixed_lengths_ = has_length_prefix;
-
- if (HandleWriteBlocked()) {
- return;
- }
-
- QUIC_DLOG(INFO) << ENDPOINT << "Sending version negotiation packet: {"
- << ParsedQuicVersionVectorToString(
- framer_.supported_versions())
- << "}, " << (ietf_quic ? "" : "!") << "ietf_quic";
- std::unique_ptr<QuicEncryptedPacket> version_packet(
- packet_creator_.SerializeVersionNegotiationPacket(
- ietf_quic, has_length_prefix, framer_.supported_versions()));
- QUIC_DVLOG(2) << ENDPOINT << "Sending version negotiation packet: {"
- << ParsedQuicVersionVectorToString(framer_.supported_versions())
- << "}, " << (ietf_quic ? "" : "!") << "ietf_quic:" << std::endl
- << quiche::QuicheTextUtils::HexDump(quiche::QuicheStringPiece(
- version_packet->data(), version_packet->length()));
- WriteResult result = writer_->WritePacket(
- version_packet->data(), version_packet->length(), self_address().host(),
- peer_address(), per_packet_options_);
-
- if (IsWriteError(result.status)) {
- OnWriteError(result.error_code);
- return;
- }
- if (IsWriteBlockedStatus(result.status)) {
- visitor_->OnWriteBlocked();
- if (result.status == WRITE_STATUS_BLOCKED_DATA_BUFFERED) {
- pending_version_negotiation_packet_ = false;
- }
- return;
- }
-
- pending_version_negotiation_packet_ = false;
-}
-
void QuicConnection::MaybeActivateLegacyVersionEncapsulation() {
if (!legacy_version_encapsulation_enabled_) {
return;
@@ -2475,12 +2431,6 @@
void QuicConnection::WriteQueuedPackets() {
DCHECK(!writer_->IsWriteBlocked());
- if (pending_version_negotiation_packet_) {
- SendVersionNegotiationPacket(
- send_ietf_version_negotiation_packet_,
- send_version_negotiation_packet_with_prefixed_lengths_);
- }
-
QUIC_CLIENT_HISTOGRAM_COUNTS("QuicSession.NumQueuedPacketsBeforeWrite",
buffered_packets_.size(), 1, 1000, 50, "");
@@ -3686,8 +3636,7 @@
}
bool QuicConnection::HasQueuedData() const {
- return pending_version_negotiation_packet_ ||
- packet_creator_.HasPendingFrames() || !buffered_packets_.empty();
+ return packet_creator_.HasPendingFrames() || !buffered_packets_.empty();
}
void QuicConnection::SetNetworkTimeouts(QuicTime::Delta handshake_timeout,
diff --git a/quic/core/quic_connection.h b/quic/core/quic_connection.h
index f9ff508..5e4bf82 100644
--- a/quic/core/quic_connection.h
+++ b/quic/core/quic_connection.h
@@ -1480,13 +1480,6 @@
// Maximum number of tracked packets.
QuicPacketCount max_tracked_packets_;
- // When the version negotiation packet could not be sent because the socket
- // was not writable, this is set to true.
- bool pending_version_negotiation_packet_;
- // Used when pending_version_negotiation_packet_ is true.
- bool send_ietf_version_negotiation_packet_;
- bool send_version_negotiation_packet_with_prefixed_lengths_;
-
// Contains the connection close packets if the connection has been closed.
std::unique_ptr<std::vector<std::unique_ptr<QuicEncryptedPacket>>>
termination_packets_;