Commit 6c01508f authored by Pierangelo Masarati's avatar Pierangelo Masarati
Browse files

cleanup needed for tool mode compatibility (may need work)

parent c846d75b
......@@ -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 );
}
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