Added SLAP_MR_VALUE_NORMALIZED_MATCH, avoid redundant normalize when

calling value_find with already-normalized DNs
This commit is contained in:
Howard Chu 2002-12-04 18:19:46 +00:00
parent 5efa571ad2
commit 09679eb715
7 changed files with 15 additions and 8 deletions

View File

@ -888,7 +888,8 @@ dn_match_cleanup:;
at != NULL;
at = attrs_find( at->a_next, b->a_dn_at ) )
{
if( value_find( b->a_dn_at, at->a_vals, &bv ) == 0 ) {
if( value_find_ex( b->a_dn_at,
SLAP_MR_VALUE_NORMALIZED_MATCH, at->a_vals, &bv ) == 0 ) {
/* found it */
match = 1;
break;
@ -1801,7 +1802,7 @@ aci_mask(
at != NULL;
at = attrs_find( at->a_next, ad ) )
{
if (value_find( ad, at->a_vals, &bv) == 0 ) {
if (value_find( ad, SLAP_MR_VALUE_NORMALIZED_MATCH, at->a_vals, &bv) == 0 ) {
rc = 1;
break;
}

View File

@ -205,7 +205,8 @@ dn2entry_retry:
group_oc_name, group_at_name, 0 );
#endif
if( value_find( group_at, attr->a_vals, op_ndn ) != LDAP_SUCCESS ) {
if( value_find_ex( group_at, SLAP_MR_VALUE_NORMALIZED_MATCH,
attr->a_vals, op_ndn ) != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
LDAP_LOG( BACK_BDB, DETAIL1,
"bdb_group: \"%s\" not in \"%s\": %s\n",

View File

@ -82,7 +82,8 @@ ldap_back_group(
* attribute has not been required
*/
if ((attr = attr_find(target->e_attrs, group_at)) != NULL) {
if( value_find( group_at, attr->a_vals, op_ndn ) != LDAP_SUCCESS )
if( value_find_ex( group_at, SLAP_MR_VALUE_NORMALIZED_MATCH,
attr->a_vals, op_ndn ) != LDAP_SUCCESS )
return(1);
return(0);
} /* else: repeat the search */

View File

@ -178,7 +178,8 @@ ldbm_back_group(
#endif
if( value_find( group_at, attr->a_vals, op_ndn ) != LDAP_SUCCESS ) {
if( value_find_ex( group_at, SLAP_MR_VALUE_NORMALIZED_MATCH,
attr->a_vals, op_ndn ) != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, DETAIL1,
"ldbm_back_group: \"%s\" not in \"%s\": %s\n",

View File

@ -144,8 +144,9 @@ meta_back_group(
*/
attr = attr_find( target->e_attrs, group_at );
if ( attr != NULL ) {
rc = value_find( group_at, attr->a_vals,
op_ndn );
rc = value_find_ex( group_at,
SLAP_MR_VALUE_SYNTAX_CONVERTED_MATCH,
attr->a_vals, op_ndn );
if ( rc != LDAP_SUCCESS ) {
return 1;
}

View File

@ -439,6 +439,7 @@ typedef struct slap_matching_rule {
#define SLAP_MR_ASSERTION_SYNTAX_MATCH 0x0000U
#define SLAP_MR_VALUE_SYNTAX_MATCH 0x0001U
#define SLAP_MR_VALUE_SYNTAX_CONVERTED_MATCH 0x0003U
#define SLAP_MR_VALUE_NORMALIZED_MATCH 0x0004U
#define SLAP_IS_MR_ASSERTION_SYNTAX_MATCH( usage ) \
(!((usage) & SLAP_MR_VALUE_SYNTAX_MATCH))

View File

@ -391,7 +391,8 @@ int value_find_ex(
flags |= SLAP_MR_VALUE_SYNTAX_CONVERTED_MATCH;
}
if( mr->smr_syntax->ssyn_normalize ) {
if( !(flags & SLAP_MR_VALUE_NORMALIZED_MATCH) &&
mr->smr_syntax->ssyn_normalize ) {
struct berval nval_tmp = { 0, NULL };
rc = mr->smr_syntax->ssyn_normalize(