Set max number of outgoing concurrent streams to 100 by default
Instead of using nonsensical large value for max outgoing concurrent streams, use more sensible value, 100.
This commit is contained in:
parent
478a423bcf
commit
a151a44caf
|
@ -609,7 +609,16 @@ typedef enum {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @macro
|
* @macro
|
||||||
* Default maximum concurrent streams.
|
*
|
||||||
|
* Default maximum number of incoming concurrent streams. Use
|
||||||
|
* `nghttp2_submit_settings()` with
|
||||||
|
* :enum:`NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS` to change the
|
||||||
|
* maximum number of incoming concurrent streams.
|
||||||
|
*
|
||||||
|
* .. note::
|
||||||
|
*
|
||||||
|
* The maximum number of outgoing concurrent streams is 100 by
|
||||||
|
* default.
|
||||||
*/
|
*/
|
||||||
#define NGHTTP2_INITIAL_MAX_CONCURRENT_STREAMS ((1U << 31) - 1)
|
#define NGHTTP2_INITIAL_MAX_CONCURRENT_STREAMS ((1U << 31) - 1)
|
||||||
|
|
||||||
|
|
|
@ -372,6 +372,9 @@ static int session_new(nghttp2_session **session_ptr,
|
||||||
(*session_ptr)->max_incoming_reserved_streams =
|
(*session_ptr)->max_incoming_reserved_streams =
|
||||||
NGHTTP2_MAX_INCOMING_RESERVED_STREAMS;
|
NGHTTP2_MAX_INCOMING_RESERVED_STREAMS;
|
||||||
|
|
||||||
|
/* Limit max outgoing concurrent streams to sensible value */
|
||||||
|
(*session_ptr)->remote_settings.max_concurrent_streams = 100;
|
||||||
|
|
||||||
if (option) {
|
if (option) {
|
||||||
if ((option->opt_set_mask & NGHTTP2_OPT_NO_AUTO_WINDOW_UPDATE) &&
|
if ((option->opt_set_mask & NGHTTP2_OPT_NO_AUTO_WINDOW_UPDATE) &&
|
||||||
option->no_auto_window_update) {
|
option->no_auto_window_update) {
|
||||||
|
|
|
@ -95,8 +95,7 @@ constexpr auto anchors = std::array<Anchor, 5>{{
|
||||||
Config::Config()
|
Config::Config()
|
||||||
: header_table_size(-1),
|
: header_table_size(-1),
|
||||||
min_header_table_size(std::numeric_limits<uint32_t>::max()), padding(0),
|
min_header_table_size(std::numeric_limits<uint32_t>::max()), padding(0),
|
||||||
max_concurrent_streams(100),
|
max_concurrent_streams(100), peer_max_concurrent_streams(100),
|
||||||
peer_max_concurrent_streams(NGHTTP2_INITIAL_MAX_CONCURRENT_STREAMS),
|
|
||||||
weight(NGHTTP2_DEFAULT_WEIGHT), multiply(1), timeout(0.), window_bits(-1),
|
weight(NGHTTP2_DEFAULT_WEIGHT), multiply(1), timeout(0.), window_bits(-1),
|
||||||
connection_window_bits(-1), verbose(0), null_out(false),
|
connection_window_bits(-1), verbose(0), null_out(false),
|
||||||
remote_name(false), get_assets(false), stat(false), upgrade(false),
|
remote_name(false), get_assets(false), stat(false), upgrade(false),
|
||||||
|
|
Loading…
Reference in New Issue