]> git.sur5r.net Git - openldap/commitdiff
ITS#3559 fix hdb dn2idl idl_cache usage
authorHoward Chu <hyc@openldap.org>
Mon, 21 Feb 2005 11:11:00 +0000 (11:11 +0000)
committerHoward Chu <hyc@openldap.org>
Mon, 21 Feb 2005 11:11:00 +0000 (11:11 +0000)
servers/slapd/back-bdb/dn2id.c

index b1eee39761040af88865352a4d0461cf10a9a1e7..c76c8ea613288a9eac2353b30ca83e39d3d48e01 100644 (file)
@@ -825,6 +825,16 @@ hdb_dn2idl_internal(
        struct dn2id_cookie *cx
 )
 {
+       BDB_IDL_ZERO( cx->tmp );
+
+       if ( !cx->ei ) {
+               cx->ei = bdb_cache_find_info( cx->bdb, cx->id );
+               if ( !cx->ei ) {
+                       cx->rc = DB_NOTFOUND;
+                       goto saveit;
+               }
+       }
+
        if ( cx->bdb->bi_idl_cache_size ) {
                cx->key.data = &cx->id;
                cx->rc = bdb_idl_cache_get(cx->bdb, cx->db, &cx->key, cx->tmp);
@@ -835,15 +845,6 @@ hdb_dn2idl_internal(
                        goto gotit;
                }
        }
-       BDB_IDL_ZERO( cx->tmp );
-
-       if ( !cx->ei ) {
-               cx->ei = bdb_cache_find_info( cx->bdb, cx->id );
-               if ( !cx->ei ) {
-                       cx->rc = DB_NOTFOUND;
-                       goto saveit;
-               }
-       }
 
        bdb_cache_entryinfo_lock( cx->ei );