gfe-relnote: (n/a) In QuicClientBase, mark version negotiated when the client reconnects. Test only.

This is an attempt to deflake test SimpleRequestResponseZeroConnectionID and ZeroConnectionID.

PiperOrigin-RevId: 293356478
Change-Id: I63bbed4fde7a9fe71a1100660c7c82750c0bf74f
diff --git a/quic/core/quic_connection.cc b/quic/core/quic_connection.cc
index 246d9d9..a8a269c 100644
--- a/quic/core/quic_connection.cc
+++ b/quic/core/quic_connection.cc
@@ -384,8 +384,7 @@
   // On the server side, version negotiation has been done by the dispatcher,
   // and the server connection is created with the right version.
   if (perspective_ == Perspective::IS_SERVER) {
-    version_negotiated_ = true;
-    framer_.InferPacketHeaderTypeFromVersion();
+    SetVersionNegotiated();
   }
 }
 
diff --git a/quic/core/quic_connection.h b/quic/core/quic_connection.h
index 56d88a3..b932164 100644
--- a/quic/core/quic_connection.h
+++ b/quic/core/quic_connection.h
@@ -484,6 +484,15 @@
     return framer_.supported_versions();
   }
 
+  // Mark version negotiated for this connection. Once called, the connection
+  // will ignore received version negotiation packets.
+  void SetVersionNegotiated() {
+    version_negotiated_ = true;
+    if (perspective_ == Perspective::IS_SERVER) {
+      framer_.InferPacketHeaderTypeFromVersion();
+    }
+  }
+
   // From QuicFramerVisitorInterface
   void OnError(QuicFramer* framer) override;
   bool OnProtocolVersionMismatch(ParsedQuicVersion received_version) override;