[nginx] svn commit: r4999 - trunk/src/http/modules

ru at nginx.com ru at nginx.com
Wed Dec 26 14:46:06 UTC 2012


Author: ru
Date: 2012-12-26 14:46:06 +0000 (Wed, 26 Dec 2012)
New Revision: 4999
URL: http://trac.nginx.org/nginx/changeset/4999/nginx

Log:
Upstream keepalive: detect duplicate "keepalive" directive.

A failure to detect duplicate "keepalive" directive resulted in
stack exhaustion.


Modified:
   trunk/src/http/modules/ngx_http_upstream_keepalive_module.c

Modified: trunk/src/http/modules/ngx_http_upstream_keepalive_module.c
===================================================================
--- trunk/src/http/modules/ngx_http_upstream_keepalive_module.c	2012-12-26 09:29:37 UTC (rev 4998)
+++ trunk/src/http/modules/ngx_http_upstream_keepalive_module.c	2012-12-26 14:46:06 UTC (rev 4999)
@@ -502,6 +502,10 @@
     kcf = ngx_http_conf_upstream_srv_conf(uscf,
                                           ngx_http_upstream_keepalive_module);
 
+    if (kcf->original_init_upstream) {
+        return "is duplicate";
+    }
+
     kcf->original_init_upstream = uscf->peer.init_upstream
                                   ? uscf->peer.init_upstream
                                   : ngx_http_upstream_init_round_robin;



More information about the nginx-devel mailing list