# HG changeset patch # User Igor Sysoev # Date 1198765114 0 # Node ID a37fe5ceacc461fb9e237314e58cb2d9975bc929 # Parent adca43955f79ac1702773870d8f2fba8eff5420a inherit $memached_key index and memcached_pass upstream inside "if" block diff --git a/src/http/modules/ngx_http_memcached_module.c b/src/http/modules/ngx_http_memcached_module.c --- a/src/http/modules/ngx_http_memcached_module.c +++ b/src/http/modules/ngx_http_memcached_module.c @@ -524,8 +524,6 @@ ngx_http_memcached_create_loc_conf(ngx_c * conf->upstream.schema = { 0, NULL }; * conf->upstream.uri = { 0, NULL }; * conf->upstream.location = NULL; - * - * conf->index = 0; */ conf->upstream.connect_timeout = NGX_CONF_UNSET_MSEC; @@ -548,6 +546,8 @@ ngx_http_memcached_create_loc_conf(ngx_c conf->upstream.pass_request_headers = 0; conf->upstream.pass_request_body = 0; + conf->index = NGX_CONF_UNSET; + return conf; } @@ -582,6 +582,15 @@ ngx_http_memcached_merge_loc_conf(ngx_co |NGX_HTTP_UPSTREAM_FT_OFF; } + if (conf->upstream.upstream == NULL) { + conf->upstream.upstream = prev->upstream.upstream; + conf->upstream.schema = prev->upstream.schema; + } + + if (conf->index == NGX_CONF_UNSET) { + conf->index = prev->index; + } + return NGX_CONF_OK; }