diff options
author | Igor Sysoev <igor@sysoev.ru> | 2011-08-31 09:40:55 +0000 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2011-08-31 09:40:55 +0000 |
commit | f560419c541b9bcc8d320cb866f0e46477f79b52 (patch) | |
tree | 793bde7b19ce60fdc5170fdc63b335c77f13cfd5 /src/http/ngx_http_core_module.c | |
parent | e81c293289327812329b5b08668db6f848f6c4ec (diff) | |
download | nginx-f560419c541b9bcc8d320cb866f0e46477f79b52.tar.gz nginx-f560419c541b9bcc8d320cb866f0e46477f79b52.zip |
The "max_ranges" directive.
"max_ranges 0" disables ranges support at all,
"max_ranges 1" allows the single range, etc.
By default number of ranges is unlimited, to be precise, 2^31-1.
Diffstat (limited to 'src/http/ngx_http_core_module.c')
-rw-r--r-- | src/http/ngx_http_core_module.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c index bbb9311cf..ebe22ceaf 100644 --- a/src/http/ngx_http_core_module.c +++ b/src/http/ngx_http_core_module.c @@ -631,6 +631,13 @@ static ngx_command_t ngx_http_core_commands[] = { offsetof(ngx_http_core_loc_conf_t, if_modified_since), &ngx_http_core_if_modified_since }, + { ngx_string("max_ranges"), + NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1, + ngx_conf_set_num_slot, + NGX_HTTP_LOC_CONF_OFFSET, + offsetof(ngx_http_core_loc_conf_t, max_ranges), + NULL }, + { ngx_string("chunked_transfer_encoding"), NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1, ngx_conf_set_flag_slot, @@ -3253,6 +3260,7 @@ ngx_http_core_create_loc_conf(ngx_conf_t *cf) clcf->keepalive_disable = NGX_CONF_UNSET_UINT; clcf->satisfy = NGX_CONF_UNSET_UINT; clcf->if_modified_since = NGX_CONF_UNSET_UINT; + clcf->max_ranges = NGX_CONF_UNSET_UINT; clcf->client_body_in_file_only = NGX_CONF_UNSET_UINT; clcf->client_body_in_single_buffer = NGX_CONF_UNSET; clcf->internal = NGX_CONF_UNSET; @@ -3459,6 +3467,8 @@ ngx_http_core_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child) NGX_HTTP_SATISFY_ALL); ngx_conf_merge_uint_value(conf->if_modified_since, prev->if_modified_since, NGX_HTTP_IMS_EXACT); + ngx_conf_merge_uint_value(conf->max_ranges, prev->max_ranges, + 0x7fffffff); ngx_conf_merge_uint_value(conf->client_body_in_file_only, prev->client_body_in_file_only, 0); ngx_conf_merge_value(conf->client_body_in_single_buffer, |