Commit 2c3c10d6 authored by Quanah Gibson-Mount's avatar Quanah Gibson-Mount
Browse files

ITS#6360

parent 36f9e4e1
......@@ -12,7 +12,8 @@ OpenLDAP 2.4.20 Engineering
Fixed slapd debug handling of LDAP_DEBUG_ANY (ITS#6324)
Fixed slapd termination for one level DNs (ITS#6338)
Fixed slapd unused parameter (ITS#6356)
Fixed slapd-bdb cache corruption (ITS#6341)
Fixed slapd-bdb/hdb cache corruption (ITS#6341)
Fixed slapd-bdb/hdb entry cache (ITS#6360)
Fixed slapd-ldap leak (ITS#6326)
Fixed slapd-relay bind segfault (ITS#6337)
Fixed slapo-memberof operational attr updates (ITS#6329)
......
......@@ -972,6 +972,9 @@ load1:
*/
if ( (*eip)->bei_state & CACHE_ENTRY_NOT_CACHED ) {
(*eip)->bei_state &= ~CACHE_ENTRY_NOT_CACHED;
ldap_pvt_thread_mutex_lock( &bdb->bi_cache.c_count_mutex );
++bdb->bi_cache.c_cursize;
ldap_pvt_thread_mutex_unlock( &bdb->bi_cache.c_count_mutex );
}
flag &= ~ID_NOCACHE;
}
......@@ -1069,20 +1072,17 @@ load1:
if ( rc == 0 ) {
int purge = 0;
if ( bdb->bi_cache.c_cursize > bdb->bi_cache.c_maxsize ||
( bdb->bi_cache.c_eimax && bdb->bi_cache.c_leaves > bdb->bi_cache.c_eimax )) {
if (( load && !( flag & ID_NOCACHE )) || bdb->bi_cache.c_eimax ) {
ldap_pvt_thread_mutex_lock( &bdb->bi_cache.c_count_mutex );
if ( !bdb->bi_cache.c_purging ) {
if ( load && !( flag & ID_NOCACHE )) {
bdb->bi_cache.c_cursize++;
if ( bdb->bi_cache.c_cursize > bdb->bi_cache.c_maxsize ) {
purge = 1;
bdb->bi_cache.c_purging = 1;
}
} else if ( bdb->bi_cache.c_eimax && bdb->bi_cache.c_leaves > bdb->bi_cache.c_eimax ) {
if ( load && !( flag & ID_NOCACHE )) {
bdb->bi_cache.c_cursize++;
if ( !bdb->bi_cache.c_purging && bdb->bi_cache.c_cursize > bdb->bi_cache.c_maxsize ) {
purge = 1;
bdb->bi_cache.c_purging = 1;
}
} else if ( !bdb->bi_cache.c_purging && bdb->bi_cache.c_eimax && bdb->bi_cache.c_leaves > bdb->bi_cache.c_eimax ) {
purge = 1;
bdb->bi_cache.c_purging = 1;
}
ldap_pvt_thread_mutex_unlock( &bdb->bi_cache.c_count_mutex );
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment