diff options
| author | Valentin Bartenev <vbart@nginx.com> | 2016-10-31 16:33:02 +0300 |
|---|---|---|
| committer | Valentin Bartenev <vbart@nginx.com> | 2016-10-31 16:33:02 +0300 |
| commit | df9b2b9011b89614b143808f983ace8ced0f8873 (patch) | |
| tree | 4edfb5f340cd86f5552794c9d6345ccc95d3d2e0 /src/http/v2/ngx_http_v2_module.c | |
| parent | 271d306056b0e318a63e62acd9f88c6e18ce6162 (diff) | |
| download | nginx-df9b2b9011b89614b143808f983ace8ced0f8873.tar.gz nginx-df9b2b9011b89614b143808f983ace8ced0f8873.tar.bz2 | |
HTTP/2: limited maximum number of requests in connection.
The new directive "http2_max_requests" is introduced. From users point of
view it works quite similar to "keepalive_requests" but has significantly
bigger default value that is more suitable for HTTP/2.
Diffstat (limited to 'src/http/v2/ngx_http_v2_module.c')
| -rw-r--r-- | src/http/v2/ngx_http_v2_module.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/http/v2/ngx_http_v2_module.c b/src/http/v2/ngx_http_v2_module.c index b7d99e055..032abcb64 100644 --- a/src/http/v2/ngx_http_v2_module.c +++ b/src/http/v2/ngx_http_v2_module.c @@ -73,6 +73,13 @@ static ngx_command_t ngx_http_v2_commands[] = { offsetof(ngx_http_v2_srv_conf_t, concurrent_streams), NULL }, + { ngx_string("http2_max_requests"), + NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1, + ngx_conf_set_num_slot, + NGX_HTTP_SRV_CONF_OFFSET, + offsetof(ngx_http_v2_srv_conf_t, max_requests), + NULL }, + { ngx_string("http2_max_field_size"), NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1, ngx_conf_set_size_slot, @@ -322,6 +329,7 @@ ngx_http_v2_create_srv_conf(ngx_conf_t *cf) h2scf->pool_size = NGX_CONF_UNSET_SIZE; h2scf->concurrent_streams = NGX_CONF_UNSET_UINT; + h2scf->max_requests = NGX_CONF_UNSET_UINT; h2scf->max_field_size = NGX_CONF_UNSET_SIZE; h2scf->max_header_size = NGX_CONF_UNSET_SIZE; @@ -347,6 +355,7 @@ ngx_http_v2_merge_srv_conf(ngx_conf_t *cf, void *parent, void *child) ngx_conf_merge_uint_value(conf->concurrent_streams, prev->concurrent_streams, 128); + ngx_conf_merge_uint_value(conf->max_requests, prev->max_requests, 1000); ngx_conf_merge_size_value(conf->max_field_size, prev->max_field_size, 4096); |
