[nginx] Cache: fixed slots accounting error introduced in c9d680b00744.

Dmitry Volyntsev xeioex at nginx.com
Wed Mar 23 12:01:17 UTC 2016


details:   http://hg.nginx.org/nginx/rev/22c32937a41f
branches:  
changeset: 6450:22c32937a41f
user:      Dmitry Volyntsev <xeioex at nginx.com>
date:      Wed Mar 23 14:16:31 2016 +0300
description:
Cache: fixed slots accounting error introduced in c9d680b00744.

diffstat:

 src/http/ngx_http_file_cache.c |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (18 lines):

diff -r e5076b96fd01 -r 22c32937a41f src/http/ngx_http_file_cache.c
--- a/src/http/ngx_http_file_cache.c	Tue Mar 22 15:52:28 2016 +0300
+++ b/src/http/ngx_http_file_cache.c	Wed Mar 23 14:16:31 2016 +0300
@@ -2115,12 +2115,12 @@ ngx_http_file_cache_add(ngx_http_file_ca
                            "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)],



More information about the nginx-devel mailing list