Mercurial > hg > nginx
changeset 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 | ac3690ee6c28 |
children | ffe4df586561 |
files | src/event/ngx_event.c src/http/modules/ngx_http_upstream_keepalive_module.c |
diffstat | 2 files changed, 8 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/event/ngx_event.c Mon Feb 11 14:56:14 2013 +0000 +++ b/src/event/ngx_event.c Mon Feb 11 14:58:25 2013 +0000 @@ -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;
--- 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;