From: Howard Chu Date: Fri, 28 Dec 2007 07:40:18 +0000 (+0000) Subject: ITS#5086 fix Adds in IDL cache X-Git-Tag: OPENLDAP_REL_ENG_2_4_9~20^2~265 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=7bc127aab8376f635b106abb76e412b15d27a0f6;p=openldap ITS#5086 fix Adds in IDL cache --- diff --git a/servers/slapd/back-bdb/idl.c b/servers/slapd/back-bdb/idl.c index dad12bf561..44ccbbb047 100644 --- a/servers/slapd/back-bdb/idl.c +++ b/servers/slapd/back-bdb/idl.c @@ -715,10 +715,6 @@ bdb_idl_insert_key( assert( id != NOID ); - if ( bdb->bi_idl_cache_size ) { - bdb_idl_cache_del( bdb, db, key ); - } - DBTzero( &data ); data.size = sizeof( ID ); data.ulen = data.size; @@ -891,6 +887,12 @@ fail: cursor->c_close( cursor ); return rc; } + /* If key was added (didn't already exist) and using IDL cache, + * update key in IDL cache. + */ + if ( !rc && bdb->bi_idl_cache_max_size ) { + bdb_idl_cache_add_id( bdb, db, key, id ); + } rc = cursor->c_close( cursor ); if( rc != 0 ) { Debug( LDAP_DEBUG_ANY, "=> bdb_idl_insert_key: " @@ -923,7 +925,7 @@ bdb_idl_delete_key( } assert( id != NOID ); - if ( bdb->bi_idl_cache_max_size ) { + if ( bdb->bi_idl_cache_size ) { bdb_idl_cache_del( bdb, db, key ); }