Welcome! Log In Create A New Profile

Advanced

Re: Segfault in NGINX - testcase

March 25, 2010 02:08PM
Just a quick note, if someone needs (for an addon) to traverse an rbtree,
here is the clean way:

static ngx_inline ngx_rbtree_node_t *
ngx_rbtree_next(ngx_rbtree_t *rbtree, ngx_rbtree_node_t *node)
{
ngx_rbtree_node_t *sentinel;
sentinel = rbtree->sentinel;
if( node->right != sentinel )
{
node = node->right;
while( node->left != sentinel )
node = node->left;
}
else
{
ngx_rbtree_node_t *root, *temp;
root = rbtree->root;
temp = node;
while( temp != root && node == temp->parent->right )
temp = node = temp->parent;
if( temp == root )
return sentinel;
if( node->right != temp->parent )
node = temp->parent;
}
return node;
}
Subject Author Posted

Segfault in NGINX - testcase

double March 19, 2010 04:19PM

Re: Segfault in NGINX - testcase

Maxim Dounin March 19, 2010 09:10PM

Re: Segfault in NGINX - testcase

double March 20, 2010 04:43AM

Re: Segfault in NGINX - testcase

Maxim Dounin March 20, 2010 04:34PM

Re: Segfault in NGINX - testcase

double March 20, 2010 04:48PM

Re: Segfault in NGINX - testcase

double March 25, 2010 02:08PM

Re: Segfault in NGINX - testcase

double March 25, 2010 03:30PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 58
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready