ITS#9620 Freeze cache while we search

This commit is contained in:
Ondřej Kuzník 2021-07-29 13:23:28 +01:00 committed by Quanah Gibson-Mount
parent 60c219243b
commit 94b361ed45

View file

@ -215,6 +215,9 @@ monitor_back_search( Operation *op, SlapReply *rs )
return rs->sr_err;
}
/* Freeze the cache while we're using it */
ldap_pvt_thread_rdwr_rlock( &mi->mi_cache_rwlock );
rs->sr_attrs = op->oq_search.rs_attrs;
switch ( op->oq_search.rs_scope ) {
case LDAP_SCOPE_BASE:
@ -260,6 +263,8 @@ monitor_back_search( Operation *op, SlapReply *rs )
monitor_cache_release( mi, e );
}
ldap_pvt_thread_rdwr_runlock( &mi->mi_cache_rwlock );
rs->sr_attrs = NULL;
rs->sr_err = rc;
if ( rs->sr_err != SLAPD_ABANDON ) {