comparison src/http/modules/ngx_http_limit_req_module.c @ 2611:2bce3f6416c6

improve ngx_slab_alloc() error logging
author Igor Sysoev <igor@sysoev.ru>
date Fri, 27 Mar 2009 17:00:42 +0000
parents 29d89920a749
children 038dc63b657a
comparison
equal deleted inserted replaced
2610:3a9b22405138 2611:2bce3f6416c6
455 static ngx_int_t 455 static ngx_int_t
456 ngx_http_limit_req_init_zone(ngx_shm_zone_t *shm_zone, void *data) 456 ngx_http_limit_req_init_zone(ngx_shm_zone_t *shm_zone, void *data)
457 { 457 {
458 ngx_http_limit_req_ctx_t *octx = data; 458 ngx_http_limit_req_ctx_t *octx = data;
459 459
460 size_t len;
460 ngx_rbtree_node_t *sentinel; 461 ngx_rbtree_node_t *sentinel;
461 ngx_http_limit_req_ctx_t *ctx; 462 ngx_http_limit_req_ctx_t *ctx;
462 463
463 ctx = shm_zone->data; 464 ctx = shm_zone->data;
464 465
498 return NGX_ERROR; 499 return NGX_ERROR;
499 } 500 }
500 501
501 ngx_queue_init(ctx->queue); 502 ngx_queue_init(ctx->queue);
502 503
504 len = sizeof(" in limit_req zone \"\"") + shm_zone->name.len;
505
506 ctx->shpool->log_ctx = ngx_slab_alloc(ctx->shpool, len);
507 if (ctx->shpool->log_ctx == NULL) {
508 return NGX_ERROR;
509 }
510
511 ngx_sprintf(ctx->shpool->log_ctx, " in limit_req zone \"%V\"%Z",
512 &shm_zone->name);
513
503 return NGX_OK; 514 return NGX_OK;
504 } 515 }
505 516
506 517
507 static void * 518 static void *