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
diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c
index 251f932..24102e4 100644
--- a/src/http/ngx_http_core_module.c
+++ b/src/http/ngx_http_core_module.c
@@ -2453,7 +2453,6 @@
sr->start_sec = tp->sec;
sr->start_msec = tp->msec;
- r->main->subrequests++;
r->main->count++;
*psr = sr;
diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c
index 2b3f006..c35d550 100644
--- a/src/http/ngx_http_request.c
+++ b/src/http/ngx_http_request.c
@@ -2010,6 +2010,7 @@
if (r == c->data) {
r->main->count--;
+ r->main->subrequests++;
if (!r->logged) {