diff options
| author | Maxim Dounin <mdounin@mdounin.ru> | 2014-03-31 21:38:30 +0400 |
|---|---|---|
| committer | Maxim Dounin <mdounin@mdounin.ru> | 2014-03-31 21:38:30 +0400 |
| commit | 23f66898463308fdc70ab2659273fb9804f29370 (patch) | |
| tree | 3b714d7a7014f03c13c3340cfbca22a40248b275 /src/http/modules/ngx_http_limit_req_module.c | |
| parent | 8f6958baa97b43d16185364dcfb7d68361012740 (diff) | |
| download | nginx-23f66898463308fdc70ab2659273fb9804f29370.tar.gz nginx-23f66898463308fdc70ab2659273fb9804f29370.tar.bz2 | |
Core: slab log_nomem flag.
The flag allows to suppress "ngx_slab_alloc() failed: no memory" messages
from a slab allocator, e.g., if an LRU expiration is used by a consumer
and allocation failures aren't fatal.
The flag is now used in the SSL session cache code, and in the limit_req
module.
Diffstat (limited to 'src/http/modules/ngx_http_limit_req_module.c')
| -rw-r--r-- | src/http/modules/ngx_http_limit_req_module.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/http/modules/ngx_http_limit_req_module.c b/src/http/modules/ngx_http_limit_req_module.c index d4c1ff6c3..74f7fdaa7 100644 --- a/src/http/modules/ngx_http_limit_req_module.c +++ b/src/http/modules/ngx_http_limit_req_module.c @@ -451,6 +451,8 @@ ngx_http_limit_req_lookup(ngx_http_limit_req_limit_t *limit, ngx_uint_t hash, node = ngx_slab_alloc_locked(ctx->shpool, size); if (node == NULL) { + ngx_log_error(NGX_LOG_ALERT, ngx_cycle->log, 0, + "could not allocate node%s", ctx->shpool->log_ctx); return NGX_ERROR; } } @@ -674,6 +676,8 @@ ngx_http_limit_req_init_zone(ngx_shm_zone_t *shm_zone, void *data) ngx_sprintf(ctx->shpool->log_ctx, " in limit_req zone \"%V\"%Z", &shm_zone->shm.name); + ctx->shpool->log_nomem = 0; + return NGX_OK; } |
