aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRuslan Ermilov <ru@nginx.com>2012-12-26 14:46:06 +0000
committerRuslan Ermilov <ru@nginx.com>2012-12-26 14:46:06 +0000
commitf8a6de481c9af7e7f0c0d2ab0e406e3804b8fc1c (patch)
treec8a0d22707f9de2c6a399ef01b9264d4fc09f6c7 /src
parent0a668faba4953eed082417f1d78b1a97f73a1ebe (diff)
downloadnginx-f8a6de481c9af7e7f0c0d2ab0e406e3804b8fc1c.tar.gz
nginx-f8a6de481c9af7e7f0c0d2ab0e406e3804b8fc1c.zip
Upstream keepalive: detect duplicate "keepalive" directive.
A failure to detect duplicate "keepalive" directive resulted in stack exhaustion.
Diffstat (limited to 'src')
-rw-r--r--src/http/modules/ngx_http_upstream_keepalive_module.c4
1 files changed, 4 insertions, 0 deletions
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;