Welcome! Log In Create A New Profile

Advanced

Re: a bug in limit_request module

August 22, 2012 10:56AM
On Wednesday 22 August 2012 17:49:52 chen cw wrote:
> Hi,
> The red-black tree used in limit_request module has two level of
> keys, the top is hash, and the next is the value string itself. However,
> when inserting a new node into the tree, only hash is set, the value string
> is left empty, [...]
>

Nice catch. Thank you.

wbr, Valentin V. Bartenev


Index: src/http/modules/ngx_http_limit_req_module.c
===================================================================
--- src/http/modules/ngx_http_limit_req_module.c (revision 4826)
+++ src/http/modules/ngx_http_limit_req_module.c (working copy)
@@ -444,17 +444,17 @@ ngx_http_limit_req_lookup(ngx_http_limit_req_limit

node->key = hash;

- ngx_rbtree_insert(&ctx->sh->rbtree, node);
-
lr = (ngx_http_limit_req_node_t *) &node->color;

- ngx_queue_insert_head(&ctx->sh->queue, &lr->queue);
-
lr->len = (u_char) len;
lr->excess = 0;

ngx_memcpy(lr->data, data, len);

+ ngx_rbtree_insert(&ctx->sh->rbtree, node);
+
+ ngx_queue_insert_head(&ctx->sh->queue, &lr->queue);
+
if (account) {
lr->last = now;
lr->count = 0;

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

a bug in limit_request module

chen cw 1512 August 22, 2012 09:52AM

Re: a bug in limit_request module

VBart 1201 August 22, 2012 10:56AM

Re: a bug in limit_request module

Maxim Dounin 669 September 01, 2012 05:26AM

Re: a bug in limit_request module

VBart 1274 September 03, 2012 09:38AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 181
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready