[nginx] svn commit: r4472 - trunk/src/http

mdounin at mdounin.ru mdounin at mdounin.ru
Mon Feb 13 15:33:08 UTC 2012


Author: mdounin
Date: 2012-02-13 15:33:08 +0000 (Mon, 13 Feb 2012)
New Revision: 4472

Log:
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


Modified:
   trunk/src/http/ngx_http_core_module.c
   trunk/src/http/ngx_http_request.c

Modified: trunk/src/http/ngx_http_core_module.c
===================================================================
--- trunk/src/http/ngx_http_core_module.c	2012-02-13 15:31:07 UTC (rev 4471)
+++ trunk/src/http/ngx_http_core_module.c	2012-02-13 15:33:08 UTC (rev 4472)
@@ -2453,7 +2453,6 @@
     sr->start_sec = tp->sec;
     sr->start_msec = tp->msec;
 
-    r->main->subrequests++;
     r->main->count++;
 
     *psr = sr;

Modified: trunk/src/http/ngx_http_request.c
===================================================================
--- trunk/src/http/ngx_http_request.c	2012-02-13 15:31:07 UTC (rev 4471)
+++ trunk/src/http/ngx_http_request.c	2012-02-13 15:33:08 UTC (rev 4472)
@@ -2010,6 +2010,7 @@
         if (r == c->data) {
 
             r->main->count--;
+            r->main->subrequests++;
 
             if (!r->logged) {
 



More information about the nginx-devel mailing list