From daad34ab95d8449e398abc52d092a313cc8dc21a Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sat, 15 Jun 2019 17:49:46 +0900 Subject: [PATCH] quic: Configure settings with options --- src/h2load_http3_session.cc | 4 +++- src/h2load_quic.cc | 11 ++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/h2load_http3_session.cc b/src/h2load_http3_session.cc index 99d57891..2ab22c0c 100644 --- a/src/h2load_http3_session.cc +++ b/src/h2load_http3_session.cc @@ -271,9 +271,11 @@ int Http3Session::init_conn() { nullptr, // push_stream, }; + auto config = client_->worker->config; + nghttp3_conn_settings settings; nghttp3_conn_settings_default(&settings); - settings.qpack_max_table_capacity = 4096; + settings.qpack_max_table_capacity = config->header_table_size; settings.qpack_blocked_streams = 100; auto mem = nghttp3_mem_default(); diff --git a/src/h2load_quic.cc b/src/h2load_quic.cc index fe5c6b80..a591b68b 100644 --- a/src/h2load_quic.cc +++ b/src/h2load_quic.cc @@ -569,16 +569,17 @@ int Client::quic_init(const sockaddr *local_addr, socklen_t local_addrlen, generate_cid(scid); generate_cid(dcid); + auto config = worker->config; + ngtcp2_settings settings; ngtcp2_settings_default(&settings); settings.log_printf = debug_log_printf; settings.log_printf = nullptr; settings.initial_ts = timestamp(worker->loop); - settings.max_stream_data_bidi_local = 256_k; - settings.max_stream_data_bidi_remote = 256_k; - settings.max_stream_data_uni = 256_k; - settings.max_data = 1_m; - settings.max_streams_bidi = 1; + settings.max_stream_data_bidi_local = (1 << config->window_bits) - 1; + settings.max_stream_data_uni = (1 << config->window_bits) - 1; + settings.max_data = (1 << config->connection_window_bits) - 1; + settings.max_streams_bidi = 0; settings.max_streams_uni = 100; settings.idle_timeout = 30 * NGTCP2_SECONDS;