]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/backend.c
Multi-threaded slapindex
[openldap] / servers / slapd / backend.c
index 18feb7df24433419ff42dbc35ad5838084db8fbd..77dcf4a422b7eb562738fb6e564b50a26b8820da 100644 (file)
@@ -477,7 +477,9 @@ int backend_destroy(void)
                }
                acl_destroy( bd->be_acl, frontendDB->be_acl );
 
-               assert( bd->be_replogfile == NULL );
+               if ( bd->be_replogfile != NULL ) {
+                       free( bd->be_replogfile );
+               }
                assert( bd->be_replica == NULL );
        }
 
@@ -612,7 +614,13 @@ select_backend(
                                                continue;
                                        }
                                } else {
-                                       b2 = be;
+                                       /* If any parts of the tree are glued, use the first
+                                        * match regardless of manageDSAit. Otherwise use the
+                                        * last match.
+                                        */
+                                       if( !( SLAP_DBFLAGS( be ) & ( SLAP_DBFLAG_GLUE_INSTANCE |
+                                               SLAP_DBFLAG_GLUE_SUBORDINATE )))
+                                               b2 = be;
                                }
                                return b2;
                        }
@@ -1184,19 +1192,17 @@ be_entry_get_rw(
        int rw,
        Entry **e )
 {
-       int rc;
-
        *e = NULL;
 
-       if (op->o_bd == NULL) {
-               rc = LDAP_NO_SUCH_OBJECT;
-       } else if ( op->o_bd->be_fetch ) {
-               rc = ( op->o_bd->be_fetch )( op, ndn,
-                       oc, at, rw, e );
-       } else {
-               rc = LDAP_UNWILLING_TO_PERFORM;
+       if ( op->o_bd == NULL ) {
+               return LDAP_NO_SUCH_OBJECT;
        }
-       return rc;
+
+       if ( op->o_bd->be_fetch ) {
+               return op->o_bd->be_fetch( op, ndn, oc, at, rw, e );
+       }
+
+       return LDAP_UNWILLING_TO_PERFORM;
 }
 
 int