mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-31 12:09:35 -05:00
cleanup needed for tool mode compatibility (may need work)
This commit is contained in:
parent
c846d75b8b
commit
6c01508f0c
3 changed files with 16 additions and 4 deletions
|
|
@ -99,6 +99,10 @@ cache_return_entry_rw( Cache *cache, Entry *e, int rw )
|
|||
ID id;
|
||||
int refcnt, freeit = 1;
|
||||
|
||||
if ( slapMode != SLAP_SERVER_MODE ) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* set cache mutex */
|
||||
ldap_pvt_thread_mutex_lock( &cache->c_mutex );
|
||||
|
||||
|
|
|
|||
|
|
@ -52,6 +52,10 @@ ldbm_back_entry_release_rw(
|
|||
#endif
|
||||
|
||||
} else {
|
||||
if ( e->e_private ) {
|
||||
free( e->e_private );
|
||||
e->e_private = NULL;
|
||||
}
|
||||
entry_free( e );
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -259,7 +259,9 @@ id2entry_rw( Backend *be, ID id, int rw )
|
|||
|
||||
e->e_id = id;
|
||||
|
||||
if( cache_add_entry_rw( &li->li_cache, e, rw ) != 0 ) {
|
||||
if ( slapMode == SLAP_SERVER_MODE
|
||||
&& cache_add_entry_rw( &li->li_cache, e, rw ) != 0 )
|
||||
{
|
||||
entry_free( e );
|
||||
|
||||
/* XXX this is a kludge.
|
||||
|
|
@ -300,9 +302,11 @@ id2entry_rw( Backend *be, ID id, int rw )
|
|||
rw ? "w" : "r", id, (unsigned long) e );
|
||||
#endif
|
||||
|
||||
/* marks the entry as committed, so it will get added to the cache
|
||||
* when the lock is released */
|
||||
cache_entry_commit( e );
|
||||
if ( slapMode == SLAP_SERVER_MODE ) {
|
||||
/* marks the entry as committed, so it will get added to the cache
|
||||
* when the lock is released */
|
||||
cache_entry_commit( e );
|
||||
}
|
||||
|
||||
return( e );
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue