From: Pierangelo Masarati Date: Mon, 31 Mar 2003 14:02:25 +0000 (+0000) Subject: new API cleanup in proxy cache code (more work needed) X-Git-Tag: AUTOCONF_2_57~138 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=d0b08200b74f1ffc5b6c171525881ba85e793836;p=openldap new API cleanup in proxy cache code (more work needed) --- diff --git a/servers/slapd/back-meta/cache-config.c b/servers/slapd/back-meta/cache-config.c index 30f99a4d27..fc4094066a 100644 --- a/servers/slapd/back-meta/cache-config.c +++ b/servers/slapd/back-meta/cache-config.c @@ -220,7 +220,7 @@ meta_back_cache_config( #else Debug( LDAP_DEBUG_ANY, " attributes: \n", 0, 0, 0 ); #endif - if ( attrarray = qm->attr_sets[i].attrs ) { + if ( ( attrarray = qm->attr_sets[i].attrs ) != NULL ) { for ( i=0; attrarray[i].an_name.bv_val; i++ ) #ifdef NEW_LOGGING LDAP_LOG( BACK_META, DETAIL1, "\t%s\n", diff --git a/servers/slapd/back-meta/cache-query.c b/servers/slapd/back-meta/cache-query.c index 17eae727ee..65925d229f 100644 --- a/servers/slapd/back-meta/cache-query.c +++ b/servers/slapd/back-meta/cache-query.c @@ -84,7 +84,7 @@ query_containment(query_manager* qm, } if (mrule) { rc = value_match(&ret, fs->f_ava->aa_desc, mrule, - SLAP_MR_ASSERTION_SYNTAX_MATCH, + SLAP_MR_VALUE_OF_ASSERTION_SYNTAX, &(fi->f_ava->aa_value), &(fs->f_ava->aa_value), &text); if (rc != LDAP_SUCCESS) { @@ -262,26 +262,26 @@ int base_scope_compare( int scope_stored, int scope_incoming ) { - struct berval* ndn_incoming = NULL; - struct berval* pdn_incoming = NULL; - struct berval* ndn_stored = NULL; + struct berval ndn_incoming = { 0L, NULL }; + struct berval pdn_incoming = { 0L, NULL }; + struct berval ndn_stored = { 0L, NULL }; int i; if (scope_stored < scope_incoming) return 0; - dnNormalize(NULL, dn_incoming, &ndn_incoming); - dnNormalize(NULL, dn_stored, &ndn_stored); + dnNormalize2(NULL, dn_incoming, &ndn_incoming); + dnNormalize2(NULL, dn_stored, &ndn_stored); - i = dnIsSuffix(ndn_incoming, ndn_stored); + i = dnIsSuffix(&ndn_incoming, &ndn_stored); if ( i == 0 ) return 0; switch(scope_stored) { case LDAP_SCOPE_BASE: - if (strlen(ndn_incoming->bv_val) == strlen(ndn_stored->bv_val)) + if (strlen(ndn_incoming.bv_val) == strlen(ndn_stored.bv_val)) return 1; else return 0; @@ -289,14 +289,14 @@ int base_scope_compare( case LDAP_SCOPE_ONELEVEL: switch(scope_incoming){ case LDAP_SCOPE_BASE: - dnParent(ndn_incoming, pdn_incoming); - if(strcmp(pdn_incoming->bv_val,ndn_stored->bv_val) == 0) + dnParent(&ndn_incoming, &pdn_incoming); + if(strcmp(pdn_incoming.bv_val, ndn_stored.bv_val) == 0) return 1; else return 0; break; case LDAP_SCOPE_ONELEVEL: - if (ndn_incoming->bv_len == ndn_stored->bv_len) + if (ndn_incoming.bv_len == ndn_stored.bv_len) return 1; else return 0; @@ -304,14 +304,14 @@ int base_scope_compare( default: return 0; break; - } + } case LDAP_SCOPE_SUBTREE: return 1; break; default: return 0; break; - } + } } /* Add query to query cache */