Mercurial > hg > nginx-quic
comparison src/http/modules/ngx_http_limit_req_module.c @ 5634:5024d29354f1
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.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Mon, 31 Mar 2014 21:38:30 +0400 |
parents | 5483d9e77b32 |
children | cda4fcb9294c |
comparison
equal
deleted
inserted
replaced
5633:b74f1106f920 | 5634:5024d29354f1 |
---|---|
449 if (node == NULL) { | 449 if (node == NULL) { |
450 ngx_http_limit_req_expire(ctx, 0); | 450 ngx_http_limit_req_expire(ctx, 0); |
451 | 451 |
452 node = ngx_slab_alloc_locked(ctx->shpool, size); | 452 node = ngx_slab_alloc_locked(ctx->shpool, size); |
453 if (node == NULL) { | 453 if (node == NULL) { |
454 ngx_log_error(NGX_LOG_ALERT, ngx_cycle->log, 0, | |
455 "could not allocate node%s", ctx->shpool->log_ctx); | |
454 return NGX_ERROR; | 456 return NGX_ERROR; |
455 } | 457 } |
456 } | 458 } |
457 | 459 |
458 node->key = hash; | 460 node->key = hash; |
671 return NGX_ERROR; | 673 return NGX_ERROR; |
672 } | 674 } |
673 | 675 |
674 ngx_sprintf(ctx->shpool->log_ctx, " in limit_req zone \"%V\"%Z", | 676 ngx_sprintf(ctx->shpool->log_ctx, " in limit_req zone \"%V\"%Z", |
675 &shm_zone->shm.name); | 677 &shm_zone->shm.name); |
678 | |
679 ctx->shpool->log_nomem = 0; | |
676 | 680 |
677 return NGX_OK; | 681 return NGX_OK; |
678 } | 682 } |
679 | 683 |
680 | 684 |