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:
Tatsuhiro Tsujikawa 2015-12-03 23:40:37 +09:00
parent 478a423bcf
commit a151a44caf
3 changed files with 14 additions and 3 deletions

View File

@ -609,7 +609,16 @@ typedef enum {
/**
* @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)

View File

@ -372,6 +372,9 @@ static int session_new(nghttp2_session **session_ptr,
(*session_ptr)->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->opt_set_mask & NGHTTP2_OPT_NO_AUTO_WINDOW_UPDATE) &&
option->no_auto_window_update) {

View File

@ -95,8 +95,7 @@ constexpr auto anchors = std::array<Anchor, 5>{{
Config::Config()
: header_table_size(-1),
min_header_table_size(std::numeric_limits<uint32_t>::max()), padding(0),
max_concurrent_streams(100),
peer_max_concurrent_streams(NGHTTP2_INITIAL_MAX_CONCURRENT_STREAMS),
max_concurrent_streams(100), peer_max_concurrent_streams(100),
weight(NGHTTP2_DEFAULT_WEIGHT), multiply(1), timeout(0.), window_bits(-1),
connection_window_bits(-1), verbose(0), null_out(false),
remote_name(false), get_assets(false), stat(false), upgrade(false),