Mercurial > hg > nginx-vendor-current
comparison src/http/ngx_http_file_cache.c @ 470:6866b490272e NGINX_0_7_47
nginx 0.7.47
*) Bugfix: nginx could not be built on FreeBSD 6 and early versions;
the bug had appeared in 0.7.46.
*) Bugfix: nginx could not be built on MacOSX; the bug had
appeared in 0.7.46.
*) Bugfix: if the "max_size" parameter was set, then the cache manager
might purge a whole cache; the bug had appeared in 0.7.46.
*) Change: a segmentation fault might occur in worker process, if the
"proxy_cache"/"fastcgi_cache" and the "proxy_cache_valid"/
"fastcgi_cache_valid" were set on different levels; the bug had
appeared in 0.7.46.
*) Bugfix: a segmentation fault might occur in worker process, if a
request was redirected to a proxied or FastCGI server via error_page
or try_files; the bug had appeared in 0.7.44.
author | Igor Sysoev <http://sysoev.ru> |
---|---|
date | Wed, 01 Apr 2009 00:00:00 +0400 |
parents | 56baf312c1b5 |
children | 09f0ef15d544 |
comparison
equal
deleted
inserted
replaced
469:3174b44e74fc | 470:6866b490272e |
---|---|
446 fcn->error = 0; | 446 fcn->error = 0; |
447 fcn->exists = 0; | 447 fcn->exists = 0; |
448 fcn->valid_sec = 0; | 448 fcn->valid_sec = 0; |
449 fcn->uniq = 0; | 449 fcn->uniq = 0; |
450 fcn->body_start = 0; | 450 fcn->body_start = 0; |
451 fcn->length = 0; | |
451 | 452 |
452 done: | 453 done: |
453 | 454 |
454 fcn->expire = ngx_time() + cache->inactive; | 455 fcn->expire = ngx_time() + cache->inactive; |
455 | 456 |
1062 ngx_shmtx_lock(&cache->shpool->mutex); | 1063 ngx_shmtx_lock(&cache->shpool->mutex); |
1063 | 1064 |
1064 size = *cache->size; | 1065 size = *cache->size; |
1065 | 1066 |
1066 ngx_shmtx_unlock(&cache->shpool->mutex); | 1067 ngx_shmtx_unlock(&cache->shpool->mutex); |
1068 | |
1069 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, ngx_cycle->log, 0, | |
1070 "http file cache size: %O", size); | |
1067 | 1071 |
1068 if (size < cache->max_size) { | 1072 if (size < cache->max_size) { |
1069 return next; | 1073 return next; |
1070 } | 1074 } |
1071 | 1075 |
1288 ngx_http_file_cache_valid(ngx_array_t *cache_valid, ngx_uint_t status) | 1292 ngx_http_file_cache_valid(ngx_array_t *cache_valid, ngx_uint_t status) |
1289 { | 1293 { |
1290 ngx_uint_t i; | 1294 ngx_uint_t i; |
1291 ngx_http_cache_valid_t *valid; | 1295 ngx_http_cache_valid_t *valid; |
1292 | 1296 |
1297 if (cache_valid == NULL) { | |
1298 return 0; | |
1299 } | |
1300 | |
1293 valid = cache_valid->elts; | 1301 valid = cache_valid->elts; |
1294 for (i = 0; i < cache_valid->nelts; i++) { | 1302 for (i = 0; i < cache_valid->nelts; i++) { |
1295 | 1303 |
1296 if (valid[i].status == 0) { | 1304 if (valid[i].status == 0) { |
1297 return valid[i].valid; | 1305 return valid[i].valid; |