]> git.sur5r.net Git - openldap/commitdiff
Import ITS#3245, ITS#3255 fixes from HEAD
authorHoward Chu <hyc@openldap.org>
Mon, 26 Jul 2004 00:40:08 +0000 (00:40 +0000)
committerHoward Chu <hyc@openldap.org>
Mon, 26 Jul 2004 00:40:08 +0000 (00:40 +0000)
servers/slapd/back-bdb/id2entry.c
servers/slapd/back-bdb/idl.h

index d4eb26711119a21037a44c44bfb0832f1362fcf5..2635e1d42400b5ddf3a6020fa425853bfbc5ca34 100644 (file)
@@ -265,7 +265,7 @@ int bdb_entry_get(
 #endif
 
        if( op ) boi = (struct bdb_op_info *) op->o_private;
-       if( boi != NULL && op->o_bd == boi->boi_bdb ) {
+       if( boi != NULL && op->o_bd->be_private == boi->boi_bdb->be_private ) {
                txn = boi->boi_txn;
                locker = boi->boi_locker;
        }
@@ -376,15 +376,22 @@ return_results:
        if( rc != LDAP_SUCCESS ) {
                /* free entry */
                bdb_cache_return_entry_rw(bdb->bi_dbenv, &bdb->bi_cache, e, rw, &lock);
+
        } else {
-               *ent = e;
-               /* big drag. we need a place to store a read lock so we can
-                * release it later??
-                */
-               if ( op && !boi ) {
-                       boi = op->o_tmpcalloc(1,sizeof(struct bdb_op_info),op->o_tmpmemctx);
-                       boi->boi_lock = lock;
-                       op->o_private = boi;
+               if ( slapMode == SLAP_SERVER_MODE ) {
+                       *ent = e;
+                       /* big drag. we need a place to store a read lock so we can
+                        * release it later??
+                        */
+                       if ( op && !boi ) {
+                               boi = op->o_tmpcalloc(1,sizeof(struct bdb_op_info),op->o_tmpmemctx);
+                               boi->boi_lock = lock;
+                               op->o_private = boi;
+                       }
+
+               } else {
+                       *ent = entry_dup( e );
+                       bdb_cache_return_entry_rw(bdb->bi_dbenv, &bdb->bi_cache, e, rw, &lock);
                }
        }
 
index 5b7b80c0fb6dacfe065a818d046b6647b57f9c30..c0479465e4bc5a74fc814e0bb99b72d77a46a655 100644 (file)
@@ -1,4 +1,4 @@
-/* back-bdb.h - ldap bdb back-end header file */
+/* idl.h - ldap bdb back-end ID list header file */
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *