Do not use PING only packet for RTT measure or congestion control. Client only and behind IGNP config.

PiperOrigin-RevId: 343891727
Change-Id: I814dc2623ea6533fe36ed73d9d69c09392a63d36
diff --git a/quic/core/quic_sent_packet_manager.cc b/quic/core/quic_sent_packet_manager.cc
index c823582..fba8b67 100644
--- a/quic/core/quic_sent_packet_manager.cc
+++ b/quic/core/quic_sent_packet_manager.cc
@@ -116,7 +116,8 @@
       first_pto_srtt_multiplier_(0),
       use_standard_deviation_for_pto_(false),
       pto_multiplier_without_rtt_samples_(3),
-      num_ptos_for_path_degrading_(0) {
+      num_ptos_for_path_degrading_(0),
+      ignore_pings_(false) {
   SetSendAlgorithm(congestion_control_type);
   if (pto_enabled_) {
     QUIC_RELOADABLE_FLAG_COUNT_N(quic_default_on_pto, 1, 2);
@@ -276,6 +277,10 @@
     send_algorithm_->SetInitialCongestionWindowInPackets(10);
   }
 
+  if (config.HasClientRequestedIndependentOption(kIGNP, perspective)) {
+    ignore_pings_ = true;
+  }
+
   using_pacing_ = !GetQuicFlag(FLAGS_quic_disable_pacing_for_perf_tests);
 
   if (config.HasClientSentConnectionOption(kNTLP, perspective)) {
@@ -798,6 +803,12 @@
   }
 
   bool in_flight = has_retransmittable_data == HAS_RETRANSMITTABLE_DATA;
+  if (ignore_pings_ && mutable_packet->retransmittable_frames.size() == 1 &&
+      mutable_packet->retransmittable_frames[0].type == PING_FRAME) {
+    // Dot not use PING only packet for RTT measure or congestion control.
+    in_flight = false;
+    measure_rtt = false;
+  }
   if (using_pacing_) {
     pacing_sender_.OnPacketSent(sent_time, unacked_packets_.bytes_in_flight(),
                                 packet_number, packet.encrypted_length,