diff options
author | Valentin Bartenev <vbart@nginx.com> | 2014-12-22 12:59:09 +0300 |
---|---|---|
committer | Valentin Bartenev <vbart@nginx.com> | 2014-12-22 12:59:09 +0300 |
commit | 7817df480eb4b3ddee56129b67b1fb697b367861 (patch) | |
tree | ffd87843e6c833adda02110cdb346f288df3b951 /src/http/ngx_http_file_cache.c | |
parent | b24ad4200807ff7071987ea6bc86dd164c1a1ede (diff) | |
download | nginx-7817df480eb4b3ddee56129b67b1fb697b367861.tar.gz nginx-7817df480eb4b3ddee56129b67b1fb697b367861.zip |
Upstream: added variables support to proxy_cache and friends.
Diffstat (limited to 'src/http/ngx_http_file_cache.c')
-rw-r--r-- | src/http/ngx_http_file_cache.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/http/ngx_http_file_cache.c b/src/http/ngx_http_file_cache.c index ee4bfc06d..681c913c6 100644 --- a/src/http/ngx_http_file_cache.c +++ b/src/http/ngx_http_file_cache.c @@ -2032,6 +2032,8 @@ ngx_http_file_cache_valid(ngx_array_t *cache_valid, ngx_uint_t status) char * ngx_http_file_cache_set_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) { + char *confp = conf; + off_t max_size; u_char *last, *p; time_t inactive; @@ -2040,7 +2042,8 @@ ngx_http_file_cache_set_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) ngx_int_t loader_files; ngx_msec_t loader_sleep, loader_threshold; ngx_uint_t i, n; - ngx_http_file_cache_t *cache; + ngx_array_t *caches; + ngx_http_file_cache_t *cache, **ce; cache = ngx_pcalloc(cf->pool, sizeof(ngx_http_file_cache_t)); if (cache == NULL) { @@ -2252,6 +2255,15 @@ ngx_http_file_cache_set_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) cache->inactive = inactive; cache->max_size = max_size; + caches = (ngx_array_t *) (confp + cmd->offset); + + ce = ngx_array_push(caches); + if (ce == NULL) { + return NGX_CONF_ERROR; + } + + *ce = cache; + return NGX_CONF_OK; } |