diff src/http/ngx_http_file_cache.c @ 594:3436cf38d59e NGINX_0_8_49

nginx 0.8.49 *) Feature: the "image_filter_jpeg_quality" directive supports variables. *) Bugfix: a segmentation fault might occur in a worker process, if the $geoip_region_name variables was used; the bug had appeared in 0.8.48. *) Bugfix: errors intercepted by error_page were cached only for next request; the bug had appeared in 0.8.48.
author Igor Sysoev <http://sysoev.ru>
date Mon, 09 Aug 2010 00:00:00 +0400
parents 09d5f308901f
children 6c96fdd2dfc3
line wrap: on
line diff
--- a/src/http/ngx_http_file_cache.c
+++ b/src/http/ngx_http_file_cache.c
@@ -581,6 +581,7 @@ ngx_http_file_cache_exists(ngx_http_file
 
     fcn->uses = 1;
     fcn->count = 1;
+    fcn->updating = 0;
 
 renew:
 
@@ -927,10 +928,13 @@ ngx_http_file_cache_free(ngx_http_cache_
     }
 
     if (c->error) {
-        fcn->valid_sec = c->valid_sec;
-        fcn->valid_msec = c->valid_msec;
         fcn->error = c->error;
 
+        if (c->valid_sec) {
+            fcn->valid_sec = c->valid_sec;
+            fcn->valid_msec = c->valid_msec;
+        }
+
     } else if (!fcn->exists && fcn->count == 0 && c->min_uses == 1) {
         ngx_queue_remove(&fcn->queue);
         ngx_rbtree_delete(&cache->sh->rbtree, &fcn->node);
@@ -1426,6 +1430,7 @@ ngx_http_file_cache_add(ngx_http_file_ca
         fcn->valid_msec = c->valid_msec;
         fcn->error = 0;
         fcn->exists = 1;
+        fcn->updating = 0;
         fcn->uniq = c->uniq;
         fcn->valid_sec = c->valid_sec;
         fcn->body_start = c->body_start;