[nginx] svn commit: r5057 - in branches/stable-1.2: . src/event src/http/modules

mdounin at mdounin.ru mdounin at mdounin.ru
Mon Feb 11 14:58:25 UTC 2013


Author: mdounin
Date: 2013-02-11 14:58:25 +0000 (Mon, 11 Feb 2013)
New Revision: 5057
URL: http://trac.nginx.org/nginx/changeset/5057/nginx

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


Modified:
   branches/stable-1.2/
   branches/stable-1.2/src/event/ngx_event.c
   branches/stable-1.2/src/http/modules/ngx_http_upstream_keepalive_module.c

Index: branches/stable-1.2
===================================================================
--- branches/stable-1.2	2013-02-11 14:56:14 UTC (rev 5056)
+++ branches/stable-1.2	2013-02-11 14:58:25 UTC (rev 5057)

Property changes on: branches/stable-1.2
___________________________________________________________________
Modified: svn:mergeinfo
## -1 +1 ##
-/trunk:4611-4632,4636-4657,4671-4672,4674-4676,4682,4684-4699,4704-4706,4713,4736-4741,4754,4756-4771,4775,4777-4780,4782-4785,4795,4811-4820,4822-4824,4828-4835,4840-4844,4865-4872,4885-4887,4890-4896,4913-4925,4933-4934,4939,4944-4949,4961-4969,4973-4974,4976-4994,4997,5000,5002,5011
+/trunk:4611-4632,4636-4657,4671-4672,4674-4676,4682,4684-4699,4704-4706,4713,4736-4741,4754,4756-4771,4775,4777-4780,4782-4785,4795,4811-4820,4822-4824,4828-4835,4840-4844,4865-4872,4885-4887,4890-4896,4913-4925,4933-4934,4939,4944-4949,4961-4969,4973-4974,4976-4994,4997,4999-5000,5002-5003,5011
\ No newline at end of property
Modified: branches/stable-1.2/src/event/ngx_event.c
===================================================================
--- branches/stable-1.2/src/event/ngx_event.c	2013-02-11 14:56:14 UTC (rev 5056)
+++ branches/stable-1.2/src/event/ngx_event.c	2013-02-11 14:58:25 UTC (rev 5057)
@@ -892,6 +892,10 @@
     ngx_conf_t            pcf;
     ngx_event_module_t   *m;
 
+    if (*(void **) conf) {
+        return "is duplicate";
+    }
+
     /* count the number of the event modules and set up their indices */
 
     ngx_event_max_module = 0;

Modified: branches/stable-1.2/src/http/modules/ngx_http_upstream_keepalive_module.c
===================================================================
--- branches/stable-1.2/src/http/modules/ngx_http_upstream_keepalive_module.c	2013-02-11 14:56:14 UTC (rev 5056)
+++ branches/stable-1.2/src/http/modules/ngx_http_upstream_keepalive_module.c	2013-02-11 14:58:25 UTC (rev 5057)
@@ -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