]> git.sur5r.net Git - openldap/commitdiff
new API cleanup in proxy cache code (more work needed)
authorPierangelo Masarati <ando@openldap.org>
Mon, 31 Mar 2003 14:02:25 +0000 (14:02 +0000)
committerPierangelo Masarati <ando@openldap.org>
Mon, 31 Mar 2003 14:02:25 +0000 (14:02 +0000)
servers/slapd/back-meta/cache-config.c
servers/slapd/back-meta/cache-query.c

index 30f99a4d27fb1986f92729bb776c545c66863dfe..fc4094066aade9d93e4317c8ff79ef6a9eb844db 100644 (file)
@@ -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",
index 17eae727eedb62b015fd54a8d153cc666fc61b08..65925d229f4fc2103c375c8fa9309b3f192e3856 100644 (file)
@@ -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 */