Core: protection from subrequest loops.

Without the protection, subrequest loop results in r->count overflow and
SIGSEGV.  Protection was broken in 0.7.25.

Note that this also limits number of parallel subrequests.  This
wasn't exactly the case before 0.7.25 as local subrequests were
completed directly.

See here for details:
http://nginx.org/pipermail/nginx-ru/2010-February/032184.html
This commit is contained in:
Maxim Dounin 2012-02-13 15:33:08 +00:00
parent 947fc03ca3
commit 1b0ad6ee72
2 changed files with 1 additions and 1 deletions

View File

@ -2453,7 +2453,6 @@ ngx_http_subrequest(ngx_http_request_t *r,
sr->start_sec = tp->sec;
sr->start_msec = tp->msec;
r->main->subrequests++;
r->main->count++;
*psr = sr;

View File

@ -2010,6 +2010,7 @@ 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) {