diff options
Diffstat (limited to 'src/http/modules/ngx_http_limit_conn_module.c')
-rw-r--r-- | src/http/modules/ngx_http_limit_conn_module.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/src/http/modules/ngx_http_limit_conn_module.c b/src/http/modules/ngx_http_limit_conn_module.c index 6322fd682..c119945ef 100644 --- a/src/http/modules/ngx_http_limit_conn_module.c +++ b/src/http/modules/ngx_http_limit_conn_module.c @@ -325,20 +325,15 @@ ngx_http_limit_conn_lookup(ngx_rbtree_t *rbtree, ngx_http_variable_value_t *vv, /* hash == node->key */ - do { - lcn = (ngx_http_limit_conn_node_t *) &node->color; - - rc = ngx_memn2cmp(vv->data, lcn->data, - (size_t) vv->len, (size_t) lcn->len); - if (rc == 0) { - return node; - } + lcn = (ngx_http_limit_conn_node_t *) &node->color; - node = (rc < 0) ? node->left : node->right; - - } while (node != sentinel && hash == node->key); + rc = ngx_memn2cmp(vv->data, lcn->data, + (size_t) vv->len, (size_t) lcn->len); + if (rc == 0) { + return node; + } - break; + node = (rc < 0) ? node->left : node->right; } return NULL; |