From 7c75d9db98a45e3e682a956fa27d737f2240c08a Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Thu, 5 Feb 2015 00:51:14 +0900 Subject: [PATCH] nghttpx: Set nghttp2_option_set_peer_max_concurrent_streams for HTTP/2 backend --- src/shrpx.cc | 7 ++++++- src/shrpx_config.h | 1 + src/shrpx_http2_session.cc | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/shrpx.cc b/src/shrpx.cc index 933ab074..33758ed1 100644 --- a/src/shrpx.cc +++ b/src/shrpx.cc @@ -761,8 +761,13 @@ void fill_default_config() { mod_config()->worker_frontend_connections = 0; nghttp2_option_new(&mod_config()->http2_option); + nghttp2_option_set_no_auto_window_update(get_config()->http2_option, 1); - nghttp2_option_set_no_auto_window_update(mod_config()->http2_option, 1); + nghttp2_option_new(&mod_config()->http2_client_option); + nghttp2_option_set_no_auto_window_update(get_config()->http2_client_option, + 1); + nghttp2_option_set_peer_max_concurrent_streams( + get_config()->http2_client_option, 100); mod_config()->tls_proto_mask = 0; mod_config()->no_location_rewrite = false; diff --git a/src/shrpx_config.h b/src/shrpx_config.h index 4f0a811f..5beef6fa 100644 --- a/src/shrpx_config.h +++ b/src/shrpx_config.h @@ -236,6 +236,7 @@ struct Config { FILE *http2_upstream_dump_request_header; FILE *http2_upstream_dump_response_header; nghttp2_option *http2_option; + nghttp2_option *http2_client_option; char **argv; char *cwd; size_t num_worker; diff --git a/src/shrpx_http2_session.cc b/src/shrpx_http2_session.cc index 5fc4018d..cf62e4a3 100644 --- a/src/shrpx_http2_session.cc +++ b/src/shrpx_http2_session.cc @@ -1202,7 +1202,7 @@ int Http2Session::on_connect() { } rv = nghttp2_session_client_new2(&session_, callbacks, this, - get_config()->http2_option); + get_config()->http2_client_option); if (rv != 0) { return -1;