op->o_callback = gs->prevcb;
if (op->o_callback && op->o_callback->sc_response) {
rs->sr_err = op->o_callback->sc_response( op, rs );
- } else if (rs->sr_type == REP_SEARCH) {
- rs->sr_err = send_search_entry( op, rs );
- } else {
- rs->sr_err = send_search_reference( op, rs );
- }
+ } else rs->sr_err = SLAP_CB_CONTINUE;
op->o_callback = tmp;
return rs->sr_err;
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;
}
return rc;
}
-static void
+void
send_ldap_response(
Operation *op,
SlapReply *rs )
long bytes;
if (op->o_callback && op->o_callback->sc_response) {
- op->o_callback->sc_response( op, rs );
- return;
+ rc = op->o_callback->sc_response( op, rs );
+ if ( rc != SLAP_CB_CONTINUE ) return;
}
#ifdef LDAP_CONNECTIONLESS
rs->sr_type = REP_SEARCH;
if (op->o_callback && op->o_callback->sc_response) {
- return op->o_callback->sc_response( op, rs );
+ rc = op->o_callback->sc_response( op, rs );
+ if ( rc != SLAP_CB_CONTINUE ) return rc;
}
#ifdef NEW_LOGGING
rs->sr_type = REP_SEARCHREF;
if (op->o_callback && op->o_callback->sc_response) {
- return op->o_callback->sc_response( op, rs );
+ rc = op->o_callback->sc_response( op, rs );
+ if ( rc != SLAP_CB_CONTINUE ) return rc;
}
mark = sl_mark( op->o_tmpmemctx );