Mercurial > hg > nginx
comparison src/http/modules/ngx_http_slice_filter_module.c @ 6907:d16ba0ea3434
Slice filter: fetch slices in cloned subrequests.
Previously, slice subrequest location was selected based on request URI.
If request is then redirected to a new location, its context array is cleared,
making the slice module loose current slice range information. This lead to
broken output. Now subrequests with the NGX_HTTP_SUBREQUEST_CLONE flag are
created for slices. Such subrequests stay in the same location as the parent
request and keep the right slice context.
author | Roman Arutyunyan <arut@nginx.com> |
---|---|
date | Fri, 10 Feb 2017 16:33:12 +0300 |
parents | 4f0f4f02c98f |
children | a97ad1663ef4 |
comparison
equal
deleted
inserted
replaced
6906:1aeaae6e9446 | 6907:d16ba0ea3434 |
---|---|
242 | 242 |
243 if (r->buffered) { | 243 if (r->buffered) { |
244 return rc; | 244 return rc; |
245 } | 245 } |
246 | 246 |
247 if (ngx_http_subrequest(r, &r->uri, &r->args, &sr, NULL, 0) != NGX_OK) { | 247 if (ngx_http_subrequest(r, &r->uri, &r->args, &sr, NULL, |
248 NGX_HTTP_SUBREQUEST_CLONE) | |
249 != NGX_OK) | |
250 { | |
248 return NGX_ERROR; | 251 return NGX_ERROR; |
249 } | 252 } |
250 | 253 |
251 ngx_http_set_ctx(sr, ctx, ngx_http_slice_filter_module); | 254 ngx_http_set_ctx(sr, ctx, ngx_http_slice_filter_module); |
252 | 255 |