]> 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 9453a26571c72268fc3993f5c22c12540a318be0..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,41 +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
-)
-{
-       int rc;
-       struct berval bv;
-       struct berval ndn;
-       ID id;
-
-       bv.bv_val = (char *)dn;
-       bv.bv_len = strlen( dn );
-
-       rc = dnNormalize2( NULL, &bv, &ndn );
-       if( rc != LDAP_SUCCESS ) {
-               return NOID;
-       }
-
-       id = cache_find_entry_ndn2id( be, cache, ndn.bv_val );
-
-       free( ndn.bv_val );
-       return ( id );
-}
-
 ID
 cache_find_entry_ndn2id(
        Backend         *be,
     Cache      *cache,
-    const char         *ndn
+    struct berval      *ndn
 )
 {
        Entry           e, *ep;
@@ -605,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 */
@@ -641,11 +611,11 @@ try_again:
 #ifdef NEW_LOGGING
                        LDAP_LOG(( "cache", LDAP_LEVEL_INFO,
                                   "cache_find_entry_dn2id: (%s) %ld not ready: %d\n",
-                                  ndn, id, state ));
+                                  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
 
 
@@ -663,11 +633,11 @@ try_again:
 #ifdef NEW_LOGGING
                LDAP_LOG(( "cache", LDAP_LEVEL_DETAIL1,
                           "cache_find_entry_dn2id: (%s): %ld %d tries\n",
-                          ndn, id, count ));
+                          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