Allow quic_toy_server to only use IETF QUIC
gfe-relnote: n/a, test-only
PiperOrigin-RevId: 268771484
Change-Id: I0546c2758165c4f16e7b2a3cda008e34643fdb04
diff --git a/quic/tools/quic_toy_server.cc b/quic/tools/quic_toy_server.cc
index 39f206f..c572c7a 100644
--- a/quic/tools/quic_toy_server.cc
+++ b/quic/tools/quic_toy_server.cc
@@ -49,15 +49,19 @@
: backend_factory_(backend_factory), server_factory_(server_factory) {}
int QuicToyServer::Start() {
+ ParsedQuicVersionVector supported_versions;
if (GetQuicFlag(FLAGS_quic_ietf_draft)) {
QuicVersionInitializeSupportForIetfDraft();
- quic::QuicEnableVersion(
- quic::ParsedQuicVersion(quic::PROTOCOL_TLS1_3, quic::QUIC_VERSION_99));
+ ParsedQuicVersion version(PROTOCOL_TLS1_3, QUIC_VERSION_99);
+ QuicEnableVersion(version);
+ supported_versions = {version};
+ } else {
+ supported_versions = AllSupportedVersions();
}
auto proof_source = quic::CreateDefaultProofSource();
auto backend = backend_factory_->CreateBackend();
- auto server =
- server_factory_->CreateServer(backend.get(), std::move(proof_source));
+ auto server = server_factory_->CreateServer(
+ backend.get(), std::move(proof_source), supported_versions);
if (!server->CreateUDPSocketAndListen(quic::QuicSocketAddress(
quic::QuicIpAddress::Any6(), GetQuicFlag(FLAGS_port)))) {