]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-ldbm/id2entry.c
rework op/rs structures to deal with opeartional attributes
[openldap] / servers / slapd / back-ldbm / id2entry.c
index 00b3a9977408484437ac4ef4de13844e2d5e1f2f..0f680fe4607bf4bb27394691a4c3483db35d22d9 100644 (file)
@@ -1,8 +1,17 @@
 /* id2entry.c - routines to deal with the id2entry index */
 /* $OpenLDAP$ */
-/*
- * Copyright 1998-2003 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"
@@ -250,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.
@@ -291,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 );
 }