]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-ldbm/cache.c
error message from be_entry_put tool backend function
[openldap] / servers / slapd / back-ldbm / cache.c
index 8f012501266a359395f72e07685f60bf817449a4..1a9f1c6fcfe3006acbf68e023d20bc565479c11f 100644 (file)
@@ -1,7 +1,7 @@
 /* cache.c - routines to maintain an in-core cache of entries */
 /* $OpenLDAP$ */
 /*
- * Copyright 1998-2000 The OpenLDAP Foundation, All Rights Reserved.
+ * Copyright 1998-2002 The OpenLDAP Foundation, All Rights Reserved.
  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
  */
 
@@ -563,35 +563,11 @@ cache_update_entry(
        return( 0 );
 }
 
-/*
- * cache_find_entry_dn2id - find an entry in the cache, given dn
- */
-
-ID
-cache_find_entry_dn2id(
-       Backend         *be,
-    Cache      *cache,
-    const char         *dn
-)
-{
-       char                    *ndn;
-       ID                      id;
-
-       ndn = ch_strdup( dn );
-       (void) dn_normalize( ndn );
-
-       id = cache_find_entry_ndn2id( be, cache, ndn );
-
-       free( ndn );
-
-       return ( id );
-}
-
 ID
 cache_find_entry_ndn2id(
        Backend         *be,
     Cache      *cache,
-    const char         *ndn
+    struct berval      *ndn
 )
 {
        Entry           e, *ep;
@@ -599,7 +575,7 @@ cache_find_entry_ndn2id(
        int count = 0;
 
        /* this function is always called with normalized DN */
-       e.e_ndn = (char *)ndn;
+       e.e_nname = *ndn;
 
 try_again:
        /* set cache mutex */
@@ -634,12 +610,12 @@ try_again:
 
 #ifdef NEW_LOGGING
                        LDAP_LOG(( "cache", LDAP_LEVEL_INFO,
-                                  "cache_find_entry_dn2id: (%s)%ld not ready: %d\n",
-                                  dn, id, state ));
+                                  "cache_find_entry_dn2id: (%s) %ld not ready: %d\n",
+                                  ndn->bv_val, id, state ));
 #else
                        Debug(LDAP_DEBUG_TRACE,
                                "====> cache_find_entry_dn2id(\"%s\"): %ld (not ready) %d\n",
-                               ndn, id, state);
+                               ndn->bv_val, id, state);
 #endif
 
 
@@ -656,12 +632,12 @@ try_again:
 
 #ifdef NEW_LOGGING
                LDAP_LOG(( "cache", LDAP_LEVEL_DETAIL1,
-                          "cache_find_entry_dn2id: (%s)%ld %d tries\n",
-                          dn, id, count ));
+                          "cache_find_entry_dn2id: (%s)%ld %d tries\n",
+                          ndn->bv_val, id, count ));
 #else
                Debug(LDAP_DEBUG_TRACE,
                        "====> cache_find_entry_dn2id(\"%s\"): %ld (%d tries)\n",
-                       ndn, id, count);
+                       ndn->bv_val, id, count);
 #endif