Re-arrange the order of the code to call OnConnectivityProbeReceived.

gfe-relnote: n/a, trivial refactor, no behavior change.
PiperOrigin-RevId: 263613440
Change-Id: Ic620ff49dff84eafbd2635b834ac9fb4d1192248
diff --git a/quic/core/quic_connection.cc b/quic/core/quic_connection.cc
index 73ad66e..cd065af 100644
--- a/quic/core/quic_connection.cc
+++ b/quic/core/quic_connection.cc
@@ -1307,7 +1307,18 @@
       << ENDPOINT << "Received a padded PING packet. is_probing: "
       << IsCurrentPacketConnectivityProbing();
 
-  if (perspective_ == Perspective::IS_CLIENT) {
+  if (IsCurrentPacketConnectivityProbing()) {
+    QUIC_DVLOG(1) << ENDPOINT << "Received a connectivity probing packet for "
+                  << GetServerConnectionIdAsRecipient(last_header_,
+                                                      perspective_)
+                  << " from ip:port: " << last_packet_source_address_.ToString()
+                  << " to ip:port: "
+                  << last_packet_destination_address_.ToString();
+    visitor_->OnConnectivityProbeReceived(last_packet_destination_address_,
+                                          last_packet_source_address_);
+  } else if (perspective_ == Perspective::IS_CLIENT) {
+    // This node is a client, notify that a speculative connectivity probing
+    // packet has been received anyway.
     QUIC_DVLOG(1) << ENDPOINT
                   << "Received a speculative connectivity probing packet for "
                   << GetServerConnectionIdAsRecipient(last_header_,
@@ -1318,17 +1329,6 @@
     // TODO(zhongyi): change the method name.
     visitor_->OnConnectivityProbeReceived(last_packet_destination_address_,
                                           last_packet_source_address_);
-  } else if (IsCurrentPacketConnectivityProbing()) {
-    // This node is not a client (is a server) AND the received packet was
-    // connectivity-probing, send an appropriate response.
-    QUIC_DVLOG(1) << ENDPOINT << "Received a connectivity probing packet for "
-                  << GetServerConnectionIdAsRecipient(last_header_,
-                                                      perspective_)
-                  << " from ip:port: " << last_packet_source_address_.ToString()
-                  << " to ip:port: "
-                  << last_packet_destination_address_.ToString();
-    visitor_->OnConnectivityProbeReceived(last_packet_destination_address_,
-                                          last_packet_source_address_);
   } else {
     // This node is not a client (is a server) AND the received packet was
     // NOT connectivity-probing. If the packet had PATH CHALLENGES, send