From: Howard Chu Date: Mon, 21 Feb 2005 11:11:00 +0000 (+0000) Subject: ITS#3559 fix hdb dn2idl idl_cache usage X-Git-Tag: OPENLDAP_REL_ENG_2_3_BP~145 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=2b725a3dfe6cb17346f6022237eecfdf230a3abb;p=openldap ITS#3559 fix hdb dn2idl idl_cache usage --- diff --git a/servers/slapd/back-bdb/dn2id.c b/servers/slapd/back-bdb/dn2id.c index b1eee39761..c76c8ea613 100644 --- a/servers/slapd/back-bdb/dn2id.c +++ b/servers/slapd/back-bdb/dn2id.c @@ -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 );