diff 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
line wrap: on
line diff
--- a/src/http/modules/ngx_http_limit_req_module.c
+++ b/src/http/modules/ngx_http_limit_req_module.c
@@ -457,6 +457,7 @@ ngx_http_limit_req_init_zone(ngx_shm_zon
 {
     ngx_http_limit_req_ctx_t  *octx = data;
 
+    size_t                     len;
     ngx_rbtree_node_t         *sentinel;
     ngx_http_limit_req_ctx_t  *ctx;
 
@@ -500,6 +501,16 @@ ngx_http_limit_req_init_zone(ngx_shm_zon
 
     ngx_queue_init(ctx->queue);
 
+    len = sizeof(" in limit_req zone \"\"") + shm_zone->name.len;
+
+    ctx->shpool->log_ctx = ngx_slab_alloc(ctx->shpool, len);
+    if (ctx->shpool->log_ctx == NULL) {
+        return NGX_ERROR;
+    }
+
+    ngx_sprintf(ctx->shpool->log_ctx, " in limit_req zone \"%V\"%Z",
+                &shm_zone->name);
+
     return NGX_OK;
 }