aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRuslan Ermilov <ru@nginx.com>2013-04-12 19:12:13 +0000
committerRuslan Ermilov <ru@nginx.com>2013-04-12 19:12:13 +0000
commit7ea00fb58cd22dc58ac7491b38f0aa6c0df50879 (patch)
tree2cda3d7d6114fc808534dae578c07df00dd5e41e /src
parentc79802924151aed853fd22cb52f21769a0da19d6 (diff)
downloadnginx-7ea00fb58cd22dc58ac7491b38f0aa6c0df50879.tar.gz
nginx-7ea00fb58cd22dc58ac7491b38f0aa6c0df50879.zip
Upstream: warn if multiple non-stackable balancers are installed.
Diffstat (limited to 'src')
-rw-r--r--src/http/modules/ngx_http_upstream_ip_hash_module.c5
-rw-r--r--src/http/modules/ngx_http_upstream_least_conn_module.c5
2 files changed, 10 insertions, 0 deletions
diff --git a/src/http/modules/ngx_http_upstream_ip_hash_module.c b/src/http/modules/ngx_http_upstream_ip_hash_module.c
index 89ccc2b85..29c74fd54 100644
--- a/src/http/modules/ngx_http_upstream_ip_hash_module.c
+++ b/src/http/modules/ngx_http_upstream_ip_hash_module.c
@@ -252,6 +252,11 @@ ngx_http_upstream_ip_hash(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
uscf = ngx_http_conf_get_module_srv_conf(cf, ngx_http_upstream_module);
+ if (uscf->peer.init_upstream) {
+ ngx_conf_log_error(NGX_LOG_WARN, cf, 0,
+ "load balancing method redefined");
+ }
+
uscf->peer.init_upstream = ngx_http_upstream_init_ip_hash;
uscf->flags = NGX_HTTP_UPSTREAM_CREATE
diff --git a/src/http/modules/ngx_http_upstream_least_conn_module.c b/src/http/modules/ngx_http_upstream_least_conn_module.c
index 6066ed2bb..87c4d8d61 100644
--- a/src/http/modules/ngx_http_upstream_least_conn_module.c
+++ b/src/http/modules/ngx_http_upstream_least_conn_module.c
@@ -387,6 +387,11 @@ ngx_http_upstream_least_conn(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
uscf = ngx_http_conf_get_module_srv_conf(cf, ngx_http_upstream_module);
+ if (uscf->peer.init_upstream) {
+ ngx_conf_log_error(NGX_LOG_WARN, cf, 0,
+ "load balancing method redefined");
+ }
+
uscf->peer.init_upstream = ngx_http_upstream_init_least_conn;
uscf->flags = NGX_HTTP_UPSTREAM_CREATE