summaryrefslogtreecommitdiffhomepage
path: root/src/http/ngx_http_upstream_round_robin.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/http/ngx_http_upstream_round_robin.c')
-rw-r--r--src/http/ngx_http_upstream_round_robin.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/http/ngx_http_upstream_round_robin.c b/src/http/ngx_http_upstream_round_robin.c
index 5dbd4e626..304494b3c 100644
--- a/src/http/ngx_http_upstream_round_robin.c
+++ b/src/http/ngx_http_upstream_round_robin.c
@@ -97,15 +97,15 @@ ngx_http_upstream_init_round_robin(ngx_conf_t *cf,
clcf = ngx_http_conf_get_module_loc_conf(cf, ngx_http_core_module);
- us->resolver = clcf->resolver;
- us->resolver_timeout = clcf->resolver_timeout;
+ if (us->resolver == NULL) {
+ us->resolver = clcf->resolver;
+ }
/*
- * Without "resolver_timeout" in http{}, the value is unset.
- * Even if we set it in ngx_http_core_merge_loc_conf(), it's
- * still dependent on the module order and unreliable.
+ * Without "resolver_timeout" in http{} the merged value is unset.
*/
- ngx_conf_init_msec_value(us->resolver_timeout, 30000);
+ ngx_conf_merge_msec_value(us->resolver_timeout,
+ clcf->resolver_timeout, 30000);
if (resolve
&& (us->resolver == NULL