]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/backend.c
Silently ignore if back-ldif is not present
[openldap] / servers / slapd / backend.c
index 0698243ed421a21fcc83f1ab9460777d995d9528..f64e661ea75ba9fcd7ff92e61a44acbb2121ac16 100644 (file)
@@ -62,9 +62,6 @@ BackendInfo           *backendInfo = NULL;
 int                    nBackendDB = 0; 
 BackendDB              *backendDB = NULL;
 
-ldap_pvt_thread_pool_t syncrepl_pool;
-int                    syncrepl_pool_max = SLAP_MAX_SYNCREPL_THREADS;
-
 static int
 backend_init_controls( BackendInfo *bi )
 {
@@ -95,8 +92,6 @@ int backend_init(void)
 {
        int rc = -1;
 
-       ldap_pvt_thread_pool_init( &syncrepl_pool, syncrepl_pool_max, 0 );
-
        if((nBackendInfo != 0) || (backendInfo != NULL)) {
                /* already initialized */
                Debug( LDAP_DEBUG_ANY,
@@ -205,27 +200,29 @@ backend_set_controls( BackendDB *be )
                        AC_MEMCPY( be->be_ctrls, bi->bi_ctrls,
                                        sizeof( be->be_ctrls ) );
                        be->be_ctrls[ SLAP_MAX_CIDS ] = 1;
-
+                       
                } else {
                        int     i;
-
+                       
                        for ( i = 0; i < SLAP_MAX_CIDS; i++ ) {
                                if ( bi->bi_ctrls[ i ] ) {
                                        be->be_ctrls[ i ] = bi->bi_ctrls[ i ];
                                }
                        }
                }
+
        }
 
        return 0;
 }
 
-
 /* startup a specific backend database */
 int backend_startup_one(Backend *be)
 {
        int             rc = 0;
 
+       assert( be );
+
        be->be_pending_csn_list = (struct be_pcl *)
                ch_calloc( 1, sizeof( struct be_pcl ));
 
@@ -235,7 +232,10 @@ int backend_startup_one(Backend *be)
                "backend_startup_one: starting \"%s\"\n",
                be->be_suffix ? be->be_suffix[0].bv_val : "(unknown)",
                0, 0 );
+
+       /* set database controls */
        (void)backend_set_controls( be );
+
        if ( be->bd_info->bi_db_open ) {
                rc = be->bd_info->bi_db_open( be );
                if ( rc == 0 ) {
@@ -438,8 +438,6 @@ int backend_destroy(void)
        BackendDB *bd;
        struct slap_csn_entry *csne;
 
-       ldap_pvt_thread_pool_destroy( &syncrepl_pool, 1 );
-
        /* destroy each backend database */
        for( i = 0, bd = backendDB; i < nBackendDB; i++, bd++ ) {
 
@@ -859,7 +857,7 @@ backend_connection_destroy(
        return 0;
 }
 
-static int
+int
 backend_check_controls(
        Operation *op,
        SlapReply *rs )
@@ -906,7 +904,7 @@ backend_check_controls(
 
                        default:
                                /* unreachable */
-                               rs->sr_err = "unable to check control";
+                               rs->sr_text = "unable to check control";
                                rs->sr_err = LDAP_OTHER;
                                goto done;
                        }
@@ -1804,18 +1802,7 @@ int backend_operational(
        if (( SLAP_OPATTRS( rs->sr_attr_flags ) || rs->sr_attrs ) &&
                op->o_bd && op->o_bd->be_operational != NULL )
        {
-               Attribute       *a;
-               
-               a = rs->sr_operational_attrs;
-               rs->sr_operational_attrs = NULL;
                rc = op->o_bd->be_operational( op, rs );
-               *ap = rs->sr_operational_attrs;
-               if ( a != NULL ) {
-                       rs->sr_operational_attrs = a;
-               }
-
-               for ( ; *ap; ap = &(*ap)->a_next )
-                       /* just count them */ ;
        }
        op->o_bd = be_orig;