Mercurial > hg > nginx-quic
comparison src/http/ngx_http_file_cache.c @ 5951:610832763648
Upstream: added variables support to proxy_cache and friends.
author | Valentin Bartenev <vbart@nginx.com> |
---|---|
date | Mon, 22 Dec 2014 12:59:09 +0300 |
parents | 1573fc7875fa |
children | f7584d7c0ccb |
comparison
equal
deleted
inserted
replaced
5950:eaeecf00d5d7 | 5951:610832763648 |
---|---|
2030 | 2030 |
2031 | 2031 |
2032 char * | 2032 char * |
2033 ngx_http_file_cache_set_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) | 2033 ngx_http_file_cache_set_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) |
2034 { | 2034 { |
2035 char *confp = conf; | |
2036 | |
2035 off_t max_size; | 2037 off_t max_size; |
2036 u_char *last, *p; | 2038 u_char *last, *p; |
2037 time_t inactive; | 2039 time_t inactive; |
2038 ssize_t size; | 2040 ssize_t size; |
2039 ngx_str_t s, name, *value; | 2041 ngx_str_t s, name, *value; |
2040 ngx_int_t loader_files; | 2042 ngx_int_t loader_files; |
2041 ngx_msec_t loader_sleep, loader_threshold; | 2043 ngx_msec_t loader_sleep, loader_threshold; |
2042 ngx_uint_t i, n; | 2044 ngx_uint_t i, n; |
2043 ngx_http_file_cache_t *cache; | 2045 ngx_array_t *caches; |
2046 ngx_http_file_cache_t *cache, **ce; | |
2044 | 2047 |
2045 cache = ngx_pcalloc(cf->pool, sizeof(ngx_http_file_cache_t)); | 2048 cache = ngx_pcalloc(cf->pool, sizeof(ngx_http_file_cache_t)); |
2046 if (cache == NULL) { | 2049 if (cache == NULL) { |
2047 return NGX_CONF_ERROR; | 2050 return NGX_CONF_ERROR; |
2048 } | 2051 } |
2250 cache->shm_zone->data = cache; | 2253 cache->shm_zone->data = cache; |
2251 | 2254 |
2252 cache->inactive = inactive; | 2255 cache->inactive = inactive; |
2253 cache->max_size = max_size; | 2256 cache->max_size = max_size; |
2254 | 2257 |
2258 caches = (ngx_array_t *) (confp + cmd->offset); | |
2259 | |
2260 ce = ngx_array_push(caches); | |
2261 if (ce == NULL) { | |
2262 return NGX_CONF_ERROR; | |
2263 } | |
2264 | |
2265 *ce = cache; | |
2266 | |
2255 return NGX_CONF_OK; | 2267 return NGX_CONF_OK; |
2256 } | 2268 } |
2257 | 2269 |
2258 | 2270 |
2259 char * | 2271 char * |