comparison src/http/ngx_http_file_cache.c @ 6450:22c32937a41f

Cache: fixed slots accounting error introduced in c9d680b00744.
author Dmitry Volyntsev <xeioex@nginx.com>
date Wed, 23 Mar 2016 14:16:31 +0300
parents c9d680b00744
children 3ef7bb882ad4
comparison
equal deleted inserted replaced
6449:e5076b96fd01 6450:22c32937a41f
2113 cache->fail_time = ngx_time(); 2113 cache->fail_time = ngx_time();
2114 ngx_log_error(NGX_LOG_ALERT, ngx_cycle->log, 0, 2114 ngx_log_error(NGX_LOG_ALERT, ngx_cycle->log, 0,
2115 "could not allocate node%s", cache->shpool->log_ctx); 2115 "could not allocate node%s", cache->shpool->log_ctx);
2116 } 2116 }
2117 2117
2118 cache->sh->count++;
2119
2120 ngx_shmtx_unlock(&cache->shpool->mutex); 2118 ngx_shmtx_unlock(&cache->shpool->mutex);
2121 return NGX_ERROR; 2119 return NGX_ERROR;
2122 } 2120 }
2121
2122 cache->sh->count++;
2123 2123
2124 ngx_memcpy((u_char *) &fcn->node.key, c->key, sizeof(ngx_rbtree_key_t)); 2124 ngx_memcpy((u_char *) &fcn->node.key, c->key, sizeof(ngx_rbtree_key_t));
2125 2125
2126 ngx_memcpy(fcn->key, &c->key[sizeof(ngx_rbtree_key_t)], 2126 ngx_memcpy(fcn->key, &c->key[sizeof(ngx_rbtree_key_t)],
2127 NGX_HTTP_CACHE_KEY_LEN - sizeof(ngx_rbtree_key_t)); 2127 NGX_HTTP_CACHE_KEY_LEN - sizeof(ngx_rbtree_key_t));