Mercurial > hg > nginx
comparison src/http/ngx_http_file_cache.c @ 6444:043914d19be8
Cache: report error if slab allocator fails during cache loading.
author | Dmitry Volyntsev <xeioex@nginx.com> |
---|---|
date | Fri, 18 Mar 2016 14:27:30 +0300 |
parents | 9fd738b85fad |
children | c9d680b00744 |
comparison
equal
deleted
inserted
replaced
6443:fc72784b1f52 | 6444:043914d19be8 |
---|---|
2092 if (fcn == NULL) { | 2092 if (fcn == NULL) { |
2093 | 2093 |
2094 fcn = ngx_slab_calloc_locked(cache->shpool, | 2094 fcn = ngx_slab_calloc_locked(cache->shpool, |
2095 sizeof(ngx_http_file_cache_node_t)); | 2095 sizeof(ngx_http_file_cache_node_t)); |
2096 if (fcn == NULL) { | 2096 if (fcn == NULL) { |
2097 if (cache->fail_time != ngx_time()) { | |
2098 cache->fail_time = ngx_time(); | |
2099 ngx_log_error(NGX_LOG_ALERT, ngx_cycle->log, 0, | |
2100 "could not allocate node%s", cache->shpool->log_ctx); | |
2101 } | |
2102 | |
2097 ngx_shmtx_unlock(&cache->shpool->mutex); | 2103 ngx_shmtx_unlock(&cache->shpool->mutex); |
2098 return NGX_ERROR; | 2104 return NGX_ERROR; |
2099 } | 2105 } |
2100 | 2106 |
2101 ngx_memcpy((u_char *) &fcn->node.key, c->key, sizeof(ngx_rbtree_key_t)); | 2107 ngx_memcpy((u_char *) &fcn->node.key, c->key, sizeof(ngx_rbtree_key_t)); |