]> git.kaiwu.me - nginx.git/commitdiff
Cache: fixed slots accounting error introduced in c9d680b00744.
authorDmitry Volyntsev <xeioex@nginx.com>
Wed, 23 Mar 2016 11:16:31 +0000 (14:16 +0300)
committerDmitry Volyntsev <xeioex@nginx.com>
Wed, 23 Mar 2016 11:16:31 +0000 (14:16 +0300)
src/http/ngx_http_file_cache.c

index 63ce6bb21d1e355f3f037a39ca0d7d751ee9a5f2..3561028f03f2ce29c8237f7b68669e632fed24e8 100644 (file)
@@ -2115,12 +2115,12 @@ ngx_http_file_cache_add(ngx_http_file_cache_t *cache, ngx_http_cache_t *c)
                            "could not allocate node%s", cache->shpool->log_ctx);
             }
 
-            cache->sh->count++;
-
             ngx_shmtx_unlock(&cache->shpool->mutex);
             return NGX_ERROR;
         }
 
+        cache->sh->count++;
+
         ngx_memcpy((u_char *) &fcn->node.key, c->key, sizeof(ngx_rbtree_key_t));
 
         ngx_memcpy(fcn->key, &c->key[sizeof(ngx_rbtree_key_t)],