diff options
author | Valentin Bartenev <vbart@nginx.com> | 2015-08-23 21:03:32 +0300 |
---|---|---|
committer | Valentin Bartenev <vbart@nginx.com> | 2015-08-23 21:03:32 +0300 |
commit | 0d3b15729ce1340098f098a1e3342f13183fdde2 (patch) | |
tree | 73ac75ae464f26806d5e01f251e1453e5d29c2e6 /src | |
parent | fae2488df708e7a2e5cc8d418bad2985c08d1ecb (diff) | |
download | nginx-0d3b15729ce1340098f098a1e3342f13183fdde2.tar.gz nginx-0d3b15729ce1340098f098a1e3342f13183fdde2.zip |
Limit recursive subrequests instead of simultaneous.
Diffstat (limited to 'src')
-rw-r--r-- | src/http/ngx_http_core_module.c | 6 | ||||
-rw-r--r-- | src/http/ngx_http_request.c | 1 |
2 files changed, 2 insertions, 5 deletions
diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c index 22400cafa..24627308e 100644 --- a/src/http/ngx_http_core_module.c +++ b/src/http/ngx_http_core_module.c @@ -2427,12 +2427,9 @@ ngx_http_subrequest(ngx_http_request_t *r, ngx_http_core_srv_conf_t *cscf; ngx_http_postponed_request_t *pr, *p; - r->main->subrequests--; - - if (r->main->subrequests == 0) { + if (r->subrequests == 0) { ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, "subrequests cycle while processing \"%V\"", uri); - r->main->subrequests = 1; return NGX_ERROR; } @@ -2537,6 +2534,7 @@ ngx_http_subrequest(ngx_http_request_t *r, sr->main_filter_need_in_memory = r->main_filter_need_in_memory; sr->uri_changes = NGX_HTTP_MAX_URI_CHANGES + 1; + sr->subrequests = r->subrequests - 1; tp = ngx_timeofday(); sr->start_sec = tp->sec; diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c index cd5f30230..f0a203339 100644 --- a/src/http/ngx_http_request.c +++ b/src/http/ngx_http_request.c @@ -2338,7 +2338,6 @@ ngx_http_finalize_request(ngx_http_request_t *r, ngx_int_t rc) if (r == c->data) { r->main->count--; - r->main->subrequests++; if (!r->logged) { |