aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2007-01-11 16:57:30 +0000
committerIgor Sysoev <igor@sysoev.ru>2007-01-11 16:57:30 +0000
commit1279b049b4ee4c60b3cf10e064539108bcfc9152 (patch)
tree4c1e0b414936d0be9bf4c96df18857087720f6de /src
parentec582de2dd1ea4e55b0a326e1931593882593ba2 (diff)
downloadnginx-1279b049b4ee4c60b3cf10e064539108bcfc9152.tar.gz
nginx-1279b049b4ee4c60b3cf10e064539108bcfc9152.zip
stop rbtree search early if equal hash was found
Diffstat (limited to 'src')
-rw-r--r--src/http/modules/ngx_http_limit_zone_module.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/http/modules/ngx_http_limit_zone_module.c b/src/http/modules/ngx_http_limit_zone_module.c
index abab4ad11..ca7910e39 100644
--- a/src/http/modules/ngx_http_limit_zone_module.c
+++ b/src/http/modules/ngx_http_limit_zone_module.c
@@ -173,7 +173,9 @@ ngx_http_limit_zone_handler(ngx_http_request_t *r)
continue;
}
- if (hash == node->key ){
+ /* hash == node->key */
+
+ do {
lz = (ngx_http_limit_zone_node_t *) &node->color;
if (len == (size_t) lz->len
@@ -188,7 +190,12 @@ ngx_http_limit_zone_handler(ngx_http_request_t *r)
return NGX_HTTP_SERVICE_UNAVAILABLE;
}
- }
+
+ node = node->right;
+
+ } while (node != sentinel && hash == node->key);
+
+ break;
}
n = offsetof(ngx_rbtree_node_t, color)