gfe-relnote: Call NeuterHandshakePackets() once per connection.  Protected by reloadable flag quic_neuter_handshake_packets_once.

PiperOrigin-RevId: 272734447
Change-Id: I85f2d2601adf0d59667c27a3ca5995e1df1a1589
diff --git a/quic/core/quic_sent_packet_manager.cc b/quic/core/quic_sent_packet_manager.cc
index 132eb0a..6baac98 100644
--- a/quic/core/quic_sent_packet_manager.cc
+++ b/quic/core/quic_sent_packet_manager.cc
@@ -135,8 +135,9 @@
       consecutive_pto_count_(0),
       fix_rto_retransmission_(false),
       handshake_mode_disabled_(false),
-      detect_spurious_losses_(
-          GetQuicReloadableFlag(quic_detect_spurious_loss)) {
+      detect_spurious_losses_(GetQuicReloadableFlag(quic_detect_spurious_loss)),
+      neuter_handshake_packets_once_(
+          GetQuicReloadableFlag(quic_neuter_handshake_packets_once)) {
   SetSendAlgorithm(congestion_control_type);
 }
 
@@ -343,8 +344,13 @@
 }
 
 void QuicSentPacketManager::SetHandshakeConfirmed() {
-  handshake_confirmed_ = true;
-  NeuterHandshakePackets();
+  if (!neuter_handshake_packets_once_ || !handshake_confirmed_) {
+    if (neuter_handshake_packets_once_) {
+      QUIC_RELOADABLE_FLAG_COUNT(quic_neuter_handshake_packets_once);
+    }
+    handshake_confirmed_ = true;
+    NeuterHandshakePackets();
+  }
 }
 
 void QuicSentPacketManager::PostProcessNewlyAckedPackets(
diff --git a/quic/core/quic_sent_packet_manager.h b/quic/core/quic_sent_packet_manager.h
index 352ca31..cc6f4b9 100644
--- a/quic/core/quic_sent_packet_manager.h
+++ b/quic/core/quic_sent_packet_manager.h
@@ -678,6 +678,9 @@
 
   // Latched value of quic_detect_spurious_loss.
   const bool detect_spurious_losses_;
+
+  // Latched value of quic_neuter_handshake_packets_once.
+  const bool neuter_handshake_packets_once_;
 };
 
 }  // namespace quic