typedef struct ldap_chain_cb_t {
ldap_chain_status_t lb_status;
ldap_chain_t *lb_lc;
- BI_op_func *lb_op_f;
+ slap_operation_t lb_op_type;
int lb_depth;
} ldap_chain_cb_t;
ldap_chain_op(
Operation *op,
SlapReply *rs,
- BI_op_func *op_f,
+ slap_operation_t op_type,
BerVarray ref,
int depth );
&& lb->lb_depth < lb->lb_lc->lc_max_depth
&& rs->sr_ref != NULL )
{
- rs->sr_err = ldap_chain_op( op, rs, lb->lb_op_f, rs->sr_ref, lb->lb_depth );
+ rs->sr_err = ldap_chain_op( op, rs, lb->lb_op_type,
+ rs->sr_ref, lb->lb_depth );
}
/* back-ldap tried to send result */
case LDAP_REFERRAL:
if ( lb->lb_depth < lb->lb_lc->lc_max_depth && rs->sr_ref != NULL ) {
- rs->sr_err = ldap_chain_op( op, rs, lb->lb_op_f, rs->sr_ref, lb->lb_depth );
+ rs->sr_err = ldap_chain_op( op, rs, lb->lb_op_type,
+ rs->sr_ref, lb->lb_depth );
goto retry;
}
ldap_chain_op(
Operation *op,
SlapReply *rs,
- BI_op_func *op_f,
+ slap_operation_t op_type,
BerVarray ref,
int depth )
{
op->o_log_prefix, ref->bv_val, temporary ? "temporary" : "caching" );
}
- lb->lb_op_f = op_f;
+ lb->lb_op_type = op_type;
lb->lb_depth = depth + 1;
- rc = op_f( op, &rs2 );
+ rc = (&lback->bi_op_bind)[ op_type ]( op, &rs2 );
/* note the first error */
if ( first_rc == -1 ) {
op->o_log_prefix, ref->bv_val, temporary ? "temporary" : "caching" );
}
- lb->lb_op_f = lback->bi_op_search;
+ lb->lb_op_type = op_search;
lb->lb_depth = depth + 1;
/* FIXME: should we also copy filter and scope?
/* FIXME: can we really get a referral for binds? */
op->o_req_ndn = slap_empty_bv;
op->o_conn = NULL;
- rc = ldap_chain_op( op, rs, lback->bi_op_bind, ref, 0 );
+ rc = ldap_chain_op( op, rs, op_bind, ref, 0 );
op->o_req_ndn = rndn;
op->o_conn = conn;
}
break;
case LDAP_REQ_ADD:
- rc = ldap_chain_op( op, rs, lback->bi_op_add, ref, 0 );
+ rc = ldap_chain_op( op, rs, op_add, ref, 0 );
break;
case LDAP_REQ_DELETE:
- rc = ldap_chain_op( op, rs, lback->bi_op_delete, ref, 0 );
+ rc = ldap_chain_op( op, rs, op_delete, ref, 0 );
break;
case LDAP_REQ_MODRDN:
- rc = ldap_chain_op( op, rs, lback->bi_op_modrdn, ref, 0 );
+ rc = ldap_chain_op( op, rs, op_modrdn, ref, 0 );
break;
case LDAP_REQ_MODIFY:
- rc = ldap_chain_op( op, rs, lback->bi_op_modify, ref, 0 );
+ rc = ldap_chain_op( op, rs, op_modify, ref, 0 );
break;
case LDAP_REQ_COMPARE:
- rc = ldap_chain_op( op, rs, lback->bi_op_compare, ref, 0 );
+ rc = ldap_chain_op( op, rs, op_compare, ref, 0 );
if ( rs->sr_err == LDAP_COMPARE_TRUE || rs->sr_err == LDAP_COMPARE_FALSE ) {
rc = LDAP_SUCCESS;
}
* to check limits, to make sure safe defaults
* are in place */
if ( op->ors_limit != NULL || limits_check( op, rs ) == 0 ) {
- rc = ldap_chain_op( op, rs, lback->bi_op_search, ref, 0 );
-
+ rc = ldap_chain_op( op, rs, op_search, ref, 0 );
} else {
rc = SLAP_CB_CONTINUE;
}
break;
case LDAP_REQ_EXTENDED:
- rc = ldap_chain_op( op, rs, lback->bi_extended, ref, 0 );
+ rc = ldap_chain_op( op, rs, op_extended, ref, 0 );
/* FIXME: ldap_back_extended() by design
* doesn't send result; frontend is expected
* to send it... */
slap_overinst *on
)
{
- BI_op_bind **func;
+ BackendInfo *bi;
int rc = SLAP_CB_CONTINUE;
for (; on; on=on->on_next ) {
if ( on->on_bi.bi_flags & SLAPO_BFLAG_DISABLED )
continue;
- func = &on->on_bi.bi_op_bind;
- if ( func[which] ) {
+ bi = &on->on_bi;
+ if ( (&bi->bi_op_bind)[ which ] ) {
op->o_bd->bd_info = (BackendInfo *)on;
- rc = func[which]( op, rs );
+ rc = (&bi->bi_op_bind)[ which ]( op, rs );
if ( rc != SLAP_CB_CONTINUE ) break;
}
}
if ( rc == SLAP_CB_BYPASS )
rc = SLAP_CB_CONTINUE;
- func = &oi->oi_orig->bi_op_bind;
- if ( func[which] && rc == SLAP_CB_CONTINUE ) {
- op->o_bd->bd_info = oi->oi_orig;
- rc = func[which]( op, rs );
+ bi = oi->oi_orig;
+ if ( (&bi->bi_op_bind)[ which ] && rc == SLAP_CB_CONTINUE ) {
+ op->o_bd->bd_info = bi;
+ rc = (&bi->bi_op_bind)[ which ]( op, rs );
}
/* should not fall thru this far without anything happening... */
if ( rc == SLAP_CB_CONTINUE ) {
return 0;
}
-