nghttpx: Add configuration to enable ngtcp2 logging (no cmd-line opt yet)

This commit is contained in:
Tatsuhiro Tsujikawa 2021-08-17 19:16:11 +09:00
parent 028996aff8
commit 61aae5b927
2 changed files with 9 additions and 4 deletions

View File

@ -707,6 +707,9 @@ struct QUICConfig {
struct { struct {
ev_tstamp idle; ev_tstamp idle;
} timeout; } timeout;
struct {
bool log;
} debug;
}; };
// custom error page // custom error page

View File

@ -451,9 +451,14 @@ int Http3Upstream::init(const UpstreamAddr *faddr, const Address &remote_addr,
return -1; return -1;
} }
auto config = get_config();
auto &quicconf = config->quic;
ngtcp2_settings settings; ngtcp2_settings settings;
ngtcp2_settings_default(&settings); ngtcp2_settings_default(&settings);
settings.log_printf = log_printf; if (quicconf.debug.log) {
settings.log_printf = log_printf;
}
settings.initial_ts = quic_timestamp(); settings.initial_ts = quic_timestamp();
settings.cc_algo = NGTCP2_CC_ALGO_BBR; settings.cc_algo = NGTCP2_CC_ALGO_BBR;
settings.max_window = 6_m; settings.max_window = 6_m;
@ -461,9 +466,6 @@ int Http3Upstream::init(const UpstreamAddr *faddr, const Address &remote_addr,
settings.max_udp_payload_size = SHRPX_MAX_UDP_PAYLOAD_SIZE; settings.max_udp_payload_size = SHRPX_MAX_UDP_PAYLOAD_SIZE;
settings.rand_ctx.native_handle = &worker->get_randgen(); settings.rand_ctx.native_handle = &worker->get_randgen();
auto config = get_config();
auto &quicconf = config->quic;
ngtcp2_transport_params params; ngtcp2_transport_params params;
ngtcp2_transport_params_default(&params); ngtcp2_transport_params_default(&params);
params.initial_max_streams_bidi = 100; params.initial_max_streams_bidi = 100;