comparison 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
comparison
equal deleted inserted replaced
5055:ac3690ee6c28 5056:63bc961253eb
500 uscf = ngx_http_conf_get_module_srv_conf(cf, ngx_http_upstream_module); 500 uscf = ngx_http_conf_get_module_srv_conf(cf, ngx_http_upstream_module);
501 501
502 kcf = ngx_http_conf_upstream_srv_conf(uscf, 502 kcf = ngx_http_conf_upstream_srv_conf(uscf,
503 ngx_http_upstream_keepalive_module); 503 ngx_http_upstream_keepalive_module);
504 504
505 if (kcf->original_init_upstream) {
506 return "is duplicate";
507 }
508
505 kcf->original_init_upstream = uscf->peer.init_upstream 509 kcf->original_init_upstream = uscf->peer.init_upstream
506 ? uscf->peer.init_upstream 510 ? uscf->peer.init_upstream
507 : ngx_http_upstream_init_round_robin; 511 : ngx_http_upstream_init_round_robin;
508 512
509 uscf->peer.init_upstream = ngx_http_upstream_init_keepalive; 513 uscf->peer.init_upstream = ngx_http_upstream_init_keepalive;