From: Howard Chu Date: Tue, 8 Apr 2003 11:17:20 +0000 (+0000) Subject: Better detection of new search scopes X-Git-Tag: OPENLDAP_REL_ENG_2_2_0ALPHA~427 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=d01d31e54f34e9d11cc56b2a672f22471be69ee6;p=openldap Better detection of new search scopes --- diff --git a/servers/slapd/back-bdb/search.c b/servers/slapd/back-bdb/search.c index 5b1ded7912..38b087017e 100644 --- a/servers/slapd/back-bdb/search.c +++ b/servers/slapd/back-bdb/search.c @@ -175,8 +175,8 @@ static int search_aliases( for (;;) { /* Set curscop to only the aliases in the current scope. Start with * all the aliases, obtain the IDL for the current scope, and then - * get the intersection of these two IDLs. Make sure to save a copy - * of the scope IDL since it gets clobbered. + * get the intersection of these two IDLs. Add the current scope + * to the cumulative list of candidates. */ BDB_IDL_CPY( curscop, aliases ); rs->sr_err = bdb_filter_candidates( op->o_bd, sf, subscop, NULL, NULL ); @@ -187,7 +187,7 @@ static int search_aliases( } BDB_IDL_CPY(subscop2, subscop); rs->sr_err = bdb_idl_intersection(curscop, subscop); - BDB_IDL_CPY(subscop, subscop2); + bdb_idl_union( ids, subscop2 ); /* Dereference all of the aliases in the current scope. */ cursora = 0; @@ -214,12 +214,12 @@ static int search_aliases( a = deref_base( op->o_bd, rs, a, &matched, locker, &lockr, tmp, visited ); if (a) { - /* If the target was not already in our current search scope, + /* If the target was not already in our current candidates, * make note of it in the newsubs list. * FIXME: Somehow we have to propagate these new scopes back * up to bdb_search. */ - if (bdb_idl_insert(subscop, a->e_id) == 0) { + if (bdb_idl_insert(ids, a->e_id) == 0) { bdb_idl_insert(newsubs, a->e_id); } bdb_cache_return_entry_r( bdb->bi_dbenv, &bdb->bi_cache, @@ -234,11 +234,6 @@ static int search_aliases( rs->sr_text = NULL; } } - /* All of the deref'd aliases have been added to subscop. Add these - * to our candidate list. - */ - bdb_idl_union( ids, subscop ); - /* If this is a OneLevel search, we're done; oldsubs only had one * ID in it. For a Subtree search, oldsubs may be a list of scope IDs. */