diff options
| author | Roman Arutyunyan <arut@nginx.com> | 2017-07-19 20:38:17 +0300 |
|---|---|---|
| committer | Roman Arutyunyan <arut@nginx.com> | 2017-07-19 20:38:17 +0300 |
| commit | a87e05a3312e06f88809320eb8dc39833ea4cbc3 (patch) | |
| tree | 1d4d7f06ebc82d68bc47bdb598c1f285b508ebd6 /src/http/modules | |
| parent | 2c8f93df871ef722e7fbdd8420d52f53dd056cfe (diff) | |
| download | nginx-a87e05a3312e06f88809320eb8dc39833ea4cbc3.tar.gz nginx-a87e05a3312e06f88809320eb8dc39833ea4cbc3.tar.bz2 | |
Upstream: keep request body file from removal if requested.
The new request flag "preserve_body" indicates that the request body file should
not be removed by the upstream module because it may be used later by a
subrequest. The flag is set by the SSI (ticket #585), addition and slice
modules. Additionally, it is also set by the upstream module when a background
cache update subrequest is started to prevent the request body file removal
after an internal redirect. Only the main request is now allowed to remove the
file.
Diffstat (limited to 'src/http/modules')
| -rw-r--r-- | src/http/modules/ngx_http_addition_filter_module.c | 2 | ||||
| -rw-r--r-- | src/http/modules/ngx_http_slice_filter_module.c | 2 | ||||
| -rw-r--r-- | src/http/modules/ngx_http_ssi_filter_module.c | 2 |
3 files changed, 6 insertions, 0 deletions
diff --git a/src/http/modules/ngx_http_addition_filter_module.c b/src/http/modules/ngx_http_addition_filter_module.c index 2fad0e59b..e546f0d60 100644 --- a/src/http/modules/ngx_http_addition_filter_module.c +++ b/src/http/modules/ngx_http_addition_filter_module.c @@ -123,6 +123,8 @@ ngx_http_addition_header_filter(ngx_http_request_t *r) ngx_http_clear_accept_ranges(r); ngx_http_weak_etag(r); + r->preserve_body = 1; + return ngx_http_next_header_filter(r); } diff --git a/src/http/modules/ngx_http_slice_filter_module.c b/src/http/modules/ngx_http_slice_filter_module.c index 7b9de2713..c1edbca2b 100644 --- a/src/http/modules/ngx_http_slice_filter_module.c +++ b/src/http/modules/ngx_http_slice_filter_module.c @@ -190,6 +190,8 @@ ngx_http_slice_header_filter(ngx_http_request_t *r) return rc; } + r->preserve_body = 1; + if (r->headers_out.status == NGX_HTTP_PARTIAL_CONTENT) { if (ctx->start + (off_t) slcf->size <= r->headers_out.content_offset) { ctx->start = slcf->size diff --git a/src/http/modules/ngx_http_ssi_filter_module.c b/src/http/modules/ngx_http_ssi_filter_module.c index b92ad4c02..b09ce2061 100644 --- a/src/http/modules/ngx_http_ssi_filter_module.c +++ b/src/http/modules/ngx_http_ssi_filter_module.c @@ -370,6 +370,8 @@ ngx_http_ssi_header_filter(ngx_http_request_t *r) ngx_http_clear_content_length(r); ngx_http_clear_accept_ranges(r); + r->preserve_body = 1; + if (!slcf->last_modified) { ngx_http_clear_last_modified(r); ngx_http_clear_etag(r); |
