masque_*_bin: create quiche event loop after commandline parsing Creating the event loop can generate logs, and the default logging implementation will not have initialized logging until after commandline processing has happened. Nothing before then tries to use the event loop, so this is fine. PiperOrigin-RevId: 530398974
diff --git a/quiche/quic/masque/masque_client_bin.cc b/quiche/quic/masque/masque_client_bin.cc index c4638ea..a787afd 100644 --- a/quiche/quic/masque/masque_client_bin.cc +++ b/quiche/quic/masque/masque_client_bin.cc
@@ -143,7 +143,6 @@ }; int RunMasqueClient(int argc, char* argv[]) { - quiche::QuicheSystemEventLoop system_event_loop("masque_client"); const char* usage = "Usage: masque_client [options] <url>"; // The first non-flag argument is the URI template of the MASQUE server. @@ -159,6 +158,7 @@ return 1; } + quiche::QuicheSystemEventLoop system_event_loop("masque_client"); const bool disable_certificate_verification = quiche::GetQuicheCommandLineFlag(FLAGS_disable_certificate_verification); std::unique_ptr<QuicEventLoop> event_loop =
diff --git a/quiche/quic/masque/masque_server_bin.cc b/quiche/quic/masque/masque_server_bin.cc index b7966f0..763ec55 100644 --- a/quiche/quic/masque/masque_server_bin.cc +++ b/quiche/quic/masque/masque_server_bin.cc
@@ -36,7 +36,6 @@ "Allows setting MASQUE mode, currently only valid value is \"open\"."); int main(int argc, char* argv[]) { - quiche::QuicheSystemEventLoop event_loop("masque_server"); const char* usage = "Usage: masque_server [options]"; std::vector<std::string> non_option_args = quiche::QuicheParseCommandLineFlags(usage, argc, argv); @@ -45,6 +44,7 @@ return 0; } + quiche::QuicheSystemEventLoop event_loop("masque_server"); quic::MasqueMode masque_mode = quic::MasqueMode::kOpen; std::string mode_string = quiche::GetQuicheCommandLineFlag(FLAGS_masque_mode); if (!mode_string.empty() && mode_string != "open") {