diff src/http/modules/ngx_http_limit_req_module.c @ 468:56baf312c1b5 NGINX_0_7_46

nginx 0.7.46 *) Bugfix: the previous release tarball was incorrect.
author Igor Sysoev <http://sysoev.ru>
date Mon, 30 Mar 2009 00:00:00 +0400
parents e7dbea1ee115
children 549994537f15
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
@@ -224,11 +224,6 @@ ngx_http_limit_req_handler(ngx_http_requ
         node = ngx_slab_alloc_locked(ctx->shpool, n);
         if (node == NULL) {
             ngx_shmtx_unlock(&ctx->shpool->mutex);
-
-            ngx_log_error(NGX_LOG_CRIT, r->connection->log, 0,
-                          "could not allocate memory in zone \"%V\"",
-                          &lrcf->shm_zone->name);
-
             return NGX_HTTP_SERVICE_UNAVAILABLE;
         }
     }
@@ -457,6 +452,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 +496,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;
 }