]> 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 87fbe9c2a3949dbe0d2397353bc718673e5adea3..0f680fe4607bf4bb27394691a4c3483db35d22d9 100644 (file)
@@ -2,7 +2,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 1998-2003 The OpenLDAP Foundation.
+ * Copyright 1998-2004 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -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 );
 }