Add a new OnParsedClientHelloReceived method to QuicConnection and QuicConnectionDebugVisitor.
This method will be called after the QuicSession is created and the ClientHello is parsed by the server. The QuicConnection will simply forward the parsed CHLO to the debug visitor. The base debug visitor implementation will do nothing.
I plan to use this in BDN to log the cert compression algorithms, and potentially other fields of the parsed CHLO.
PiperOrigin-RevId: 681963634
diff --git a/quiche/quic/core/quic_connection_test.cc b/quiche/quic/core/quic_connection_test.cc
index a79d5ac..1c123ce 100644
--- a/quiche/quic/core/quic_connection_test.cc
+++ b/quiche/quic/core/quic_connection_test.cc
@@ -17594,6 +17594,19 @@
connection_.OnResetStreamAtFrame(QuicResetStreamAtFrame(0, 0, 0, 20, 10));
}
+TEST_P(QuicConnectionTest, OnParsedClientHelloInfoWithDebugVisitor) {
+ const ParsedClientHello parsed_chlo{.sni = "sni",
+ .uaid = "uiad",
+ .supported_groups = {1, 2, 3},
+ .cert_compression_algos = {4, 5, 6},
+ .alpns = {"h2", "http/1.1"},
+ .retry_token = "retry_token"};
+ MockQuicConnectionDebugVisitor debug_visitor;
+ connection_.set_debug_visitor(&debug_visitor);
+ EXPECT_CALL(debug_visitor, OnParsedClientHelloInfo(parsed_chlo)).Times(1);
+ connection_.OnParsedClientHelloInfo(parsed_chlo);
+}
+
} // namespace
} // namespace test
} // namespace quic