]> git.kaiwu.me - nginx.git/commitdiff
test cache path levels while reconfiguration
authorIgor Sysoev <igor@sysoev.ru>
Mon, 10 Aug 2009 13:18:40 +0000 (13:18 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Mon, 10 Aug 2009 13:18:40 +0000 (13:18 +0000)
src/http/ngx_http_file_cache.c

index 8e908a1dc6775dea51d554a71cb21775762efccd..5d90adc48da31fe962b2d66f062b2ce8aef4014a 100644 (file)
@@ -53,6 +53,7 @@ ngx_http_file_cache_init(ngx_shm_zone_t *shm_zone, void *data)
     ngx_http_file_cache_t  *ocache = data;
 
     size_t                  len;
+    ngx_uint_t              n;
     ngx_http_file_cache_t  *cache;
 
     cache = shm_zone->data;
@@ -68,6 +69,15 @@ ngx_http_file_cache_init(ngx_shm_zone_t *shm_zone, void *data)
             return NGX_ERROR;
         }
 
+        for (n = 0; n < 3; n++) {
+            if (cache->path->level[n] != ocache->path->level[n]) {
+                ngx_log_error(NGX_LOG_EMERG, shm_zone->shm.log, 0,
+                              "cache \"%V\" had previously different levels",
+                              &shm_zone->shm.name);
+                return NGX_ERROR;
+            }
+        }
+
         cache->sh = ocache->sh;
 
         cache->shpool = ocache->shpool;