From 2b725a3dfe6cb17346f6022237eecfdf230a3abb Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Mon, 21 Feb 2005 11:11:00 +0000 Subject: [PATCH] ITS#3559 fix hdb dn2idl idl_cache usage --- servers/slapd/back-bdb/dn2id.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) 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 ); -- 2.39.5