Make ALPN an array in QuicBufferedPacketStore
This is required to support QUIC+TLS where
ALPN is encoded as a list instead of a
single value.
gfe-relnote: refactor, no behavior change, not flag protected
PiperOrigin-RevId: 307922725
Change-Id: I08bbb0dc6db9264d17a64f569cf459ca590787c9
diff --git a/quic/core/quic_dispatcher_test.cc b/quic/core/quic_dispatcher_test.cc
index cc98335..fe5adb0 100644
--- a/quic/core/quic_dispatcher_test.cc
+++ b/quic/core/quic_dispatcher_test.cc
@@ -1412,6 +1412,17 @@
ProcessFirstFlight(client_address, TestConnectionId(1));
}
+TEST_P(QuicDispatcherTestOneVersion, SelectAlpn) {
+ EXPECT_EQ(QuicDispatcherPeer::SelectAlpn(dispatcher_.get(), {}), "");
+ EXPECT_EQ(QuicDispatcherPeer::SelectAlpn(dispatcher_.get(), {""}), "");
+ EXPECT_EQ(QuicDispatcherPeer::SelectAlpn(dispatcher_.get(), {"hq"}), "hq");
+ // Q033 is no longer supported but Q050 is.
+ QuicEnableVersion(ParsedQuicVersion(PROTOCOL_QUIC_CRYPTO, QUIC_VERSION_50));
+ EXPECT_EQ(
+ QuicDispatcherPeer::SelectAlpn(dispatcher_.get(), {"h3-Q033", "h3-Q050"}),
+ "h3-Q050");
+}
+
// Verify the stopgap test: Packets with truncated connection IDs should be
// dropped.
class QuicDispatcherTestStrayPacketConnectionId