Mercurial > hg > nginx-quic
comparison src/http/ngx_http_file_cache.c @ 5984:3f568dd68af1
Cache: reduced diffs to the plus version of nginx.
No functional changes.
author | Ruslan Ermilov <ru@nginx.com> |
---|---|
date | Tue, 17 Feb 2015 16:27:52 +0300 |
parents | 99639bfdfa2a |
children | 174512857ccf |
comparison
equal
deleted
inserted
replaced
5983:69c4912066a4 | 5984:3f568dd68af1 |
---|---|
256 | 256 |
257 ngx_int_t | 257 ngx_int_t |
258 ngx_http_file_cache_open(ngx_http_request_t *r) | 258 ngx_http_file_cache_open(ngx_http_request_t *r) |
259 { | 259 { |
260 ngx_int_t rc, rv; | 260 ngx_int_t rc, rv; |
261 ngx_uint_t cold, test; | 261 ngx_uint_t test; |
262 ngx_http_cache_t *c; | 262 ngx_http_cache_t *c; |
263 ngx_pool_cleanup_t *cln; | 263 ngx_pool_cleanup_t *cln; |
264 ngx_open_file_info_t of; | 264 ngx_open_file_info_t of; |
265 ngx_http_file_cache_t *cache; | 265 ngx_http_file_cache_t *cache; |
266 ngx_http_core_loc_conf_t *clcf; | 266 ngx_http_core_loc_conf_t *clcf; |
298 | 298 |
299 if (rc == NGX_AGAIN) { | 299 if (rc == NGX_AGAIN) { |
300 return NGX_HTTP_CACHE_SCARCE; | 300 return NGX_HTTP_CACHE_SCARCE; |
301 } | 301 } |
302 | 302 |
303 cold = cache->sh->cold; | |
304 | |
305 if (rc == NGX_OK) { | 303 if (rc == NGX_OK) { |
306 | 304 |
307 if (c->error) { | 305 if (c->error) { |
308 return c->error; | 306 return c->error; |
309 } | 307 } |
312 test = c->exists ? 1 : 0; | 310 test = c->exists ? 1 : 0; |
313 rv = NGX_DECLINED; | 311 rv = NGX_DECLINED; |
314 | 312 |
315 } else { /* rc == NGX_DECLINED */ | 313 } else { /* rc == NGX_DECLINED */ |
316 | 314 |
315 test = cache->sh->cold ? 1 : 0; | |
316 | |
317 if (c->min_uses > 1) { | 317 if (c->min_uses > 1) { |
318 | 318 |
319 if (!cold) { | 319 if (!test) { |
320 return NGX_HTTP_CACHE_SCARCE; | 320 return NGX_HTTP_CACHE_SCARCE; |
321 } | 321 } |
322 | 322 |
323 test = 1; | |
324 rv = NGX_HTTP_CACHE_SCARCE; | 323 rv = NGX_HTTP_CACHE_SCARCE; |
325 | 324 |
326 } else { | 325 } else { |
327 c->temp_file = 1; | 326 c->temp_file = 1; |
328 test = cold ? 1 : 0; | |
329 rv = NGX_DECLINED; | 327 rv = NGX_DECLINED; |
330 } | 328 } |
331 } | 329 } |
332 | 330 |
333 if (ngx_http_file_cache_name(r, cache->path) != NGX_OK) { | 331 if (ngx_http_file_cache_name(r, cache->path) != NGX_OK) { |