diff --git a/src/asio_client_session_impl.cc b/src/asio_client_session_impl.cc index f7796c74..cb576d3c 100644 --- a/src/asio_client_session_impl.cc +++ b/src/asio_client_session_impl.cc @@ -315,9 +315,18 @@ bool session_impl::setup_session() { return false; } - nghttp2_settings_entry iv = {NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS, 100}; - nghttp2_submit_settings(session_, NGHTTP2_FLAG_NONE, &iv, 1); + const uint32_t window_size = 256 * 1024 * 1024; + std::array iv{ + {{NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS, 100}, + // typically client is just a *sink* and just process data as + // much as possible. Use large window size by default. + {NGHTTP2_SETTINGS_INITIAL_WINDOW_SIZE, window_size}}}; + nghttp2_submit_settings(session_, NGHTTP2_FLAG_NONE, iv.data(), iv.size()); + // increase connection window size up to window_size + nghttp2_submit_window_update(session_, NGHTTP2_FLAG_NONE, 0, + window_size - + NGHTTP2_INITIAL_CONNECTION_WINDOW_SIZE); return true; }