diff options
| author | Maxim Dounin <mdounin@mdounin.ru> | 2013-02-11 14:58:25 +0000 |
|---|---|---|
| committer | Maxim Dounin <mdounin@mdounin.ru> | 2013-02-11 14:58:25 +0000 |
| commit | 635dae7cadfdc67f439f7c7cb79a1c7f51285f4e (patch) | |
| tree | 21ec60b8f7c149b2c8584d54c19cd30ff8632607 /src | |
| parent | ff145c057451bfe40b5d59c5873091df07964831 (diff) | |
| download | nginx-635dae7cadfdc67f439f7c7cb79a1c7f51285f4e.tar.gz nginx-635dae7cadfdc67f439f7c7cb79a1c7f51285f4e.tar.bz2 | |
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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/event/ngx_event.c | 4 | ||||
| -rw-r--r-- | src/http/modules/ngx_http_upstream_keepalive_module.c | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/event/ngx_event.c b/src/event/ngx_event.c index 976bd6465..cbae0ee6a 100644 --- a/src/event/ngx_event.c +++ b/src/event/ngx_event.c @@ -892,6 +892,10 @@ ngx_events_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) 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; diff --git a/src/http/modules/ngx_http_upstream_keepalive_module.c b/src/http/modules/ngx_http_upstream_keepalive_module.c index d10e3d016..a2ad5aa8d 100644 --- a/src/http/modules/ngx_http_upstream_keepalive_module.c +++ b/src/http/modules/ngx_http_upstream_keepalive_module.c @@ -502,6 +502,10 @@ ngx_http_upstream_keepalive(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) 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; |
