From 4fd9fa238a26e16b0c233cc55bc22ac8cee25e3d Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Wed, 24 Jul 2019 23:15:15 +0900 Subject: [PATCH] Show ngtcp2 debug log with --verbose --- src/h2load_quic.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/h2load_quic.cc b/src/h2load_quic.cc index e59e5550..276bb4c9 100644 --- a/src/h2load_quic.cc +++ b/src/h2load_quic.cc @@ -386,6 +386,8 @@ void debug_log_printf(void *user_data, const char *fmt, ...) { va_start(ap, fmt); vfprintf(stderr, fmt, ap); va_end(ap); + + fprintf(stderr, "\n"); } } // namespace @@ -588,8 +590,9 @@ int Client::quic_init(const sockaddr *local_addr, socklen_t local_addrlen, ngtcp2_settings settings; ngtcp2_settings_default(&settings); - settings.log_printf = debug_log_printf; - settings.log_printf = nullptr; + if (config->verbose) { + settings.log_printf = debug_log_printf; + } settings.initial_ts = timestamp(worker->loop); settings.max_stream_data_bidi_local = (1 << config->window_bits) - 1; settings.max_stream_data_uni = (1 << config->window_bits) - 1;