comparison src/http/ngx_http_file_cache.c @ 2626:b0cfe5f66e8d

fix segfault introduced in r2602 if there is 502/504 error and proxy/fastcgi_cache is defined without proxy/fastcgi_cache_valid
author Igor Sysoev <igor@sysoev.ru>
date Mon, 30 Mar 2009 14:23:07 +0000
parents d19979e0d980
children 73571521c2eb
comparison
equal deleted inserted replaced
2625:754ab3d3fe18 2626:b0cfe5f66e8d
1288 ngx_http_file_cache_valid(ngx_array_t *cache_valid, ngx_uint_t status) 1288 ngx_http_file_cache_valid(ngx_array_t *cache_valid, ngx_uint_t status)
1289 { 1289 {
1290 ngx_uint_t i; 1290 ngx_uint_t i;
1291 ngx_http_cache_valid_t *valid; 1291 ngx_http_cache_valid_t *valid;
1292 1292
1293 if (cache_valid == NULL) {
1294 return 0;
1295 }
1296
1293 valid = cache_valid->elts; 1297 valid = cache_valid->elts;
1294 for (i = 0; i < cache_valid->nelts; i++) { 1298 for (i = 0; i < cache_valid->nelts; i++) {
1295 1299
1296 if (valid[i].status == 0) { 1300 if (valid[i].status == 0) {
1297 return valid[i].valid; 1301 return valid[i].valid;