summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2007-12-27 14:18:34 +0000
committerIgor Sysoev <igor@sysoev.ru>2007-12-27 14:18:34 +0000
commit9b1d4c15a699d26b24c56238cfcc51af2399987b (patch)
tree17f432008ca5c0ea6bf6a692156fd962f27181ce
parentfe8a327effce02bdec200e5b5a90b22b2e40af37 (diff)
downloadnginx-9b1d4c15a699d26b24c56238cfcc51af2399987b.tar.gz
nginx-9b1d4c15a699d26b24c56238cfcc51af2399987b.tar.bz2
inherit $memached_key index and memcached_pass upstream inside "if" block
Diffstat (limited to '')
-rw-r--r--src/http/modules/ngx_http_memcached_module.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/http/modules/ngx_http_memcached_module.c b/src/http/modules/ngx_http_memcached_module.c
index dbca81a7d..76a37e169 100644
--- 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_conf_t *cf)
* 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_conf_t *cf)
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_conf_t *cf, void *parent, void *child)
|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;
}