diff src/http/modules/ngx_http_limit_req_module.c @ 686:2e8a942c8872 NGINX_1_3_6

nginx 1.3.6 *) Feature: the ngx_http_gunzip_filter_module. *) Feature: the "memcached_gzip_flag" directive. *) Feature: the "always" parameter of the "gzip_static" directive. *) Bugfix: in the "limit_req" directive; the bug had appeared in 1.1.14. Thanks to Charles Chen. *) Bugfix: nginx could not be built by gcc 4.7 with -O2 optimization if the --with-ipv6 option was used.
author Igor Sysoev <http://sysoev.ru>
date Wed, 12 Sep 2012 00:00:00 +0400
parents 660139fd80ca
children
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
@@ -444,17 +444,17 @@ ngx_http_limit_req_lookup(ngx_http_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;