/* id2entry.c - routines to deal with the id2entry index */
/* $OpenLDAP$ */
-/*
- * Copyright 1998-2002 The OpenLDAP Foundation, All Rights Reserved.
- * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
+/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
+ *
+ * Copyright 1998-2004 The OpenLDAP Foundation.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted only as authorized by the OpenLDAP
+ * Public License.
+ *
+ * A copy of this license is available in the file LICENSE in the
+ * top-level directory of the distribution or, alternatively, at
+ * <http://www.OpenLDAP.org/license.html>.
*/
#include "portable.h"
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.
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 );
}