Show ngtcp2 debug log with --verbose

This commit is contained in:
Tatsuhiro Tsujikawa 2019-07-24 23:15:15 +09:00
parent 9031469735
commit 4fd9fa238a
1 changed files with 5 additions and 2 deletions

View File

@ -386,6 +386,8 @@ void debug_log_printf(void *user_data, const char *fmt, ...) {
va_start(ap, fmt); va_start(ap, fmt);
vfprintf(stderr, fmt, ap); vfprintf(stderr, fmt, ap);
va_end(ap); va_end(ap);
fprintf(stderr, "\n");
} }
} // namespace } // namespace
@ -588,8 +590,9 @@ int Client::quic_init(const sockaddr *local_addr, socklen_t local_addrlen,
ngtcp2_settings settings; ngtcp2_settings settings;
ngtcp2_settings_default(&settings); ngtcp2_settings_default(&settings);
settings.log_printf = debug_log_printf; if (config->verbose) {
settings.log_printf = nullptr; settings.log_printf = debug_log_printf;
}
settings.initial_ts = timestamp(worker->loop); settings.initial_ts = timestamp(worker->loop);
settings.max_stream_data_bidi_local = (1 << config->window_bits) - 1; settings.max_stream_data_bidi_local = (1 << config->window_bits) - 1;
settings.max_stream_data_uni = (1 << config->window_bits) - 1; settings.max_stream_data_uni = (1 << config->window_bits) - 1;