From b3bb531ecb9830ab62b78dc7253730327b939e9c Mon Sep 17 00:00:00 2001 From: Quanah Gibson-Mount Date: Sat, 9 Feb 2008 02:01:48 +0000 Subject: [PATCH] ITS#5086 --- CHANGES | 1 + servers/slapd/back-bdb/idl.c | 12 +++++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/CHANGES b/CHANGES index b08001db4c..25aa47761d 100644 --- a/CHANGES +++ b/CHANGES @@ -5,6 +5,7 @@ OpenLDAP 2.4.8 Engineering Fixed libldap ldap_parse_sasl_bind_result (ITS#5263) Fixed libldap search timeout crash (ITS#5291) Fixed ldapdelete with sizelimit (ITS#5294) + Fixed slapd idlcache on adds (ITS#5086) Fixed slapd include handling (ITS#5276) Fixed slapd multi-step SASL binds (ITS#5298) Fixed slapd non-atomic signal variables (ITS#5248) 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 ); } -- 2.39.5