]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/matchedValues.c
filter_candidate tweaks, search_stack tweaks
[openldap] / servers / slapd / matchedValues.c
index 4f0dafbdb6f22a3b977da373a4d084e71b791f35..39cb6426bb8efd85440900b3ca94e4f9dd117524 100644 (file)
 
 #include "slap.h"
 
-#include "../../libraries/liblber/lber-int.h"
-
 static int
 test_mra_vrFilter(
-       Backend         *be,
-       Connection      *conn,
        Operation       *op,
        Attribute       *a,
        MatchingRuleAssertion *mra,
@@ -31,8 +27,6 @@ test_mra_vrFilter(
 
 static int
 test_substrings_vrFilter(
-       Backend         *be,
-       Connection      *conn,
        Operation       *op,
        Attribute       *a,
        ValuesReturnFilter *f,
@@ -41,8 +35,6 @@ test_substrings_vrFilter(
 
 static int
 test_presence_vrFilter(
-       Backend         *be,
-       Connection      *conn,
        Operation       *op,
        Attribute       *a,
        AttributeDescription *desc,
@@ -51,8 +43,6 @@ test_presence_vrFilter(
 
 static int
 test_ava_vrFilter(
-       Backend         *be,
-       Connection      *conn,
        Operation       *op,
        Attribute       *a,
        AttributeAssertion *ava,
@@ -63,8 +53,6 @@ test_ava_vrFilter(
 
 int
 filter_matched_values( 
-       Backend         *be,
-       Connection      *conn,
        Operation       *op,
        Attribute       *a,
        char            ***e_flags
@@ -106,7 +94,7 @@ filter_matched_values(
 #else
                        Debug( LDAP_DEBUG_FILTER, "     EQUALITY\n", 0, 0, 0 );
 #endif
-                       rc = test_ava_vrFilter( be, conn, op, a, vrf->vrf_ava,
+                       rc = test_ava_vrFilter( op, a, vrf->vrf_ava,
                                LDAP_FILTER_EQUALITY, e_flags );
                        if( rc == -1 ) {
                                return rc;
@@ -120,7 +108,7 @@ filter_matched_values(
                        Debug( LDAP_DEBUG_FILTER, "     SUBSTRINGS\n", 0, 0, 0 );
 #endif
 
-                       rc = test_substrings_vrFilter( be, conn, op, a,
+                       rc = test_substrings_vrFilter( op, a,
                                vrf, e_flags );
                        if( rc == -1 ) {
                                return rc;
@@ -133,7 +121,7 @@ filter_matched_values(
 #else
                        Debug( LDAP_DEBUG_FILTER, "     PRESENT\n", 0, 0, 0 );
 #endif
-                       rc = test_presence_vrFilter( be, conn, op, a,
+                       rc = test_presence_vrFilter( op, a,
                                vrf->vrf_desc, e_flags );
                        if( rc == -1 ) {
                                return rc;
@@ -141,7 +129,7 @@ filter_matched_values(
                        break;
 
                case LDAP_FILTER_GE:
-                       rc = test_ava_vrFilter( be, conn, op, a, vrf->vrf_ava,
+                       rc = test_ava_vrFilter( op, a, vrf->vrf_ava,
                                LDAP_FILTER_GE, e_flags );
                        if( rc == -1 ) {
                                return rc;
@@ -149,7 +137,7 @@ filter_matched_values(
                        break;
 
                case LDAP_FILTER_LE:
-                       rc = test_ava_vrFilter( be, conn, op, a, vrf->vrf_ava,
+                       rc = test_ava_vrFilter( op, a, vrf->vrf_ava,
                                LDAP_FILTER_LE, e_flags );
                        if( rc == -1 ) {
                                return rc;
@@ -162,7 +150,7 @@ filter_matched_values(
 #else
                        Debug( LDAP_DEBUG_FILTER, "     EXT\n", 0, 0, 0 );
 #endif
-                       rc = test_mra_vrFilter( be, conn, op, a,
+                       rc = test_mra_vrFilter( op, a,
                                vrf->vrf_mra, e_flags );
                        if( rc == -1 ) {
                                return rc;
@@ -191,8 +179,6 @@ filter_matched_values(
 
 static int
 test_ava_vrFilter(
-       Backend         *be,
-       Connection      *conn,
        Operation       *op,
        Attribute       *a,
        AttributeAssertion *ava,
@@ -235,7 +221,8 @@ test_ava_vrFilter(
 
                }
 
-               for ( bv = a->a_vals, j=0; bv->bv_val != NULL; bv++, j++ ) {
+               bv = a->a_nvals;
+               for ( j=0; bv->bv_val != NULL; bv++, j++ ) {
                        int ret;
                        int rc;
                        const char *text;
@@ -273,8 +260,6 @@ test_ava_vrFilter(
 
 static int
 test_presence_vrFilter(
-       Backend         *be,
-       Connection      *conn,
        Operation       *op,
        Attribute       *a,
        AttributeDescription *desc,
@@ -299,8 +284,6 @@ test_presence_vrFilter(
 
 static int
 test_substrings_vrFilter(
-       Backend         *be,
-       Connection      *conn,
        Operation       *op,
        Attribute       *a,
        ValuesReturnFilter *vrf,
@@ -321,7 +304,8 @@ test_substrings_vrFilter(
                        continue;
                }
 
-               for ( bv = a->a_vals, j = 0; bv->bv_val != NULL; bv++, j++ ) {
+               bv = a->a_nvals;
+               for ( j = 0; bv->bv_val != NULL; bv++, j++ ) {
                        int ret;
                        int rc;
                        const char *text;
@@ -344,8 +328,6 @@ test_substrings_vrFilter(
 
 static int
 test_mra_vrFilter(
-       Backend         *be,
-       Connection      *conn,
        Operation       *op,
        Attribute       *a,
        MatchingRuleAssertion *mra,
@@ -373,26 +355,14 @@ test_mra_vrFilter(
                                continue;
                        }
 
-#ifdef SLAP_NVALUES
                        rc = asserted_value_validate_normalize( a->a_desc, mra->ma_rule,
                                SLAP_MR_EXT|SLAP_MR_VALUE_OF_ASSERTION_SYNTAX,
-                               &mra->ma_value, &value, &text );
-#else
-                       /* normalize for equality */
-                       rc = value_validate_normalize( a->a_desc, 
-                               SLAP_MR_EQUALITY,
-                               &mra->ma_value, &value,
-                               &text );
-#endif
+                               &mra->ma_value, &value, &text, op->o_tmpmemctx );
 
                        if( rc != LDAP_SUCCESS ) continue;
                }
 
-#ifdef SLAP_NVALUES
                bv = a->a_nvals;
-#else
-               bv = a->a_vals;
-#endif
                for ( j = 0; bv->bv_val != NULL; bv++, j++ ) {
                        int ret;
                        int rc;