diff src/http/modules/ngx_http_upstream_keepalive_module.c @ 5056:63bc961253eb stable-1.2

Merge of r4999, r5003: detect duplicate "events" and "keepalive". *) Upstream keepalive: detect duplicate "keepalive" directive. A failure to detect duplicate "keepalive" directive resulted in stack exhaustion. *) Events: added check for duplicate "events" directive.
author Maxim Dounin <mdounin@mdounin.ru>
date Mon, 11 Feb 2013 14:58:25 +0000
parents 0141b4aec0e4
children 089a662c17d1
line wrap: on
line diff
--- a/src/http/modules/ngx_http_upstream_keepalive_module.c	Mon Feb 11 14:56:14 2013 +0000
+++ b/src/http/modules/ngx_http_upstream_keepalive_module.c	Mon Feb 11 14:58:25 2013 +0000
@@ -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;