BI_db_open **func;
int rc = 0;
- func = &oi->oi_bi.bi_db_open;
+ func = &oi->oi_bd.bd_info->bi_db_open;
if ( func[which] ) {
rc = func[which]( &oi->oi_bd );
if ( rc ) return rc;
BackendDB bd;
int rc = 0;
- if ( oi->oi_bi.bi_db_config ) {
- rc = oi->oi_bi.bi_db_config( &oi->oi_bd, fname, lineno,
+ if ( oi->oi_bd.bd_info->bi_db_config ) {
+ rc = oi->oi_bd.bd_info->bi_db_config( &oi->oi_bd, fname, lineno,
argc, argv );
if ( rc ) return rc;
}
int rc = SLAP_CB_CONTINUE;
BackendDB *be = op->o_bd, db = *op->o_bd;
slap_callback *sc = op->o_callback->sc_private;
+ slap_callback *s0 = op->o_callback;
op->o_bd = &db;
+ op->o_callback = sc;
for (; on; on=on->on_next ) {
if ( on->on_response ) {
db.bd_info = (BackendInfo *)on;
rc = on->on_response( op, rs );
- if ( ! (rc & SLAP_CB_CONTINUE) ) break;
+ if ( rc != SLAP_CB_CONTINUE ) break;
}
}
- op->o_callback = sc;
- if ( sc && (rc & SLAP_CB_CONTINUE) ) {
+ if ( sc && (rc == SLAP_CB_CONTINUE) ) {
rc = sc->sc_response( op, rs );
}
op->o_bd = be;
- rc &= ~SLAP_CB_CONTINUE;
+ op->o_callback = s0;
return rc;
}
BI_op_bind **func;
BackendDB *be = op->o_bd, db = *op->o_bd;
slap_callback cb = {over_back_response, NULL};
- int rc = 0;
+ int rc = SLAP_CB_CONTINUE;
op->o_bd = &db;
cb.sc_private = op->o_callback;
if ( func[which] ) {
db.bd_info = (BackendInfo *)on;
rc = func[which]( op, rs );
- if ( rc ) break;
+ if ( rc != SLAP_CB_CONTINUE ) break;
}
}
- func = &oi->oi_bi.bi_op_bind;
- if ( func[which] ) {
+ op->o_bd = be;
+ func = &oi->oi_bd.bd_info->bi_op_bind;
+ if ( func[which] && rc == SLAP_CB_CONTINUE ) {
rc = func[which]( op, rs );
}
-
- op->o_bd = be;
+ /* should not fall thru this far without anything happening... */
+ if ( rc == SLAP_CB_CONTINUE ) {
+ rc = LDAP_UNWILLING_TO_PERFORM;
+ }
+ op->o_callback = cb.sc_private;
return rc;
}
*/
oi = (slap_overinfo *) be->bd_info;
for ( prev=NULL, on2 = oi->oi_list; on2; prev=on2, on2=on2->on_next );
- on2 = ch_malloc( sizeof(slap_overinst) );
+ on2 = ch_calloc( 1, sizeof(slap_overinst) );
if ( !prev ) {
oi->oi_list = on2;
} else {
prev->on_next = on2;
}
*on2 = *on;
+ on2->on_next = NULL;
+ on2->on_info = oi;
/* Any initialization needed? */
if ( on->on_bi.bi_db_init ) {