mirror of
https://github.com/nginx/nginx.git
synced 2025-06-08 02:02:38 +08:00
Upstream keepalive: detect duplicate "keepalive" directive.
A failure to detect duplicate "keepalive" directive resulted in stack exhaustion.
This commit is contained in:
parent
0a668faba4
commit
f8a6de481c
@ -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,
|
kcf = ngx_http_conf_upstream_srv_conf(uscf,
|
||||||
ngx_http_upstream_keepalive_module);
|
ngx_http_upstream_keepalive_module);
|
||||||
|
|
||||||
|
if (kcf->original_init_upstream) {
|
||||||
|
return "is duplicate";
|
||||||
|
}
|
||||||
|
|
||||||
kcf->original_init_upstream = uscf->peer.init_upstream
|
kcf->original_init_upstream = uscf->peer.init_upstream
|
||||||
? uscf->peer.init_upstream
|
? uscf->peer.init_upstream
|
||||||
: ngx_http_upstream_init_round_robin;
|
: ngx_http_upstream_init_round_robin;
|
||||||
|
Loading…
Reference in New Issue
Block a user