relay_back_add_cb( &cb, op );
op->o_bd = bd;
- rc = ( bd->be_bind )( op, rs );
+ rc = bd->be_bind( op, rs );
op->o_bd = be;
if ( op->o_callback == &cb ) {
relay_back_add_cb( &cb, op );
op->o_bd = bd;
- rc = ( bd->be_unbind )( op, rs );
+ rc = bd->be_unbind( op, rs );
op->o_bd = be;
if ( op->o_callback == &cb ) {
relay_back_add_cb( &cb, op );
op->o_bd = bd;
- rc = ( bd->be_search )( op, rs );
+ rc = bd->be_search( op, rs );
op->o_bd = be;
if ( op->o_callback == &cb ) {
relay_back_add_cb( &cb, op );
op->o_bd = bd;
- rc = ( bd->be_compare )( op, rs );
+ rc = bd->be_compare( op, rs );
op->o_bd = be;
if ( op->o_callback == &cb ) {
relay_back_add_cb( &cb, op );
op->o_bd = bd;
- rc = ( bd->be_modify )( op, rs );
+ rc = bd->be_modify( op, rs );
op->o_bd = be;
if ( op->o_callback == &cb ) {
relay_back_add_cb( &cb, op );
op->o_bd = bd;
- rc = ( bd->be_modrdn )( op, rs );
+ rc = bd->be_modrdn( op, rs );
op->o_bd = be;
if ( op->o_callback == &cb ) {
relay_back_add_cb( &cb, op );
op->o_bd = bd;
- rc = ( bd->be_add )( op, rs );
+ rc = bd->be_add( op, rs );
op->o_bd = be;
if ( op->o_callback == &cb ) {
relay_back_add_cb( &cb, op );
op->o_bd = bd;
- rc = ( bd->be_delete )( op, rs );
+ rc = bd->be_delete( op, rs );
op->o_bd = be;
if ( op->o_callback == &cb ) {
relay_back_add_cb( &cb, op );
op->o_bd = bd;
- rc = ( bd->be_abandon )( op, rs );
+ rc = bd->be_abandon( op, rs );
op->o_bd = be;
if ( op->o_callback == &cb ) {
relay_back_add_cb( &cb, op );
op->o_bd = bd;
- rc = ( bd->be_cancel )( op, rs );
+ rc = bd->be_cancel( op, rs );
op->o_bd = be;
if ( op->o_callback == &cb ) {
relay_back_add_cb( &cb, op );
op->o_bd = bd;
- rc = ( bd->be_extended )( op, rs );
+ rc = bd->be_extended( op, rs );
op->o_bd = be;
if ( op->o_callback == &cb ) {
BackendDB *be = op->o_bd;
op->o_bd = bd;
- rc = ( bd->be_release )( op, e, rw );
+ rc = bd->be_release( op, e, rw );
op->o_bd = be;
}
BackendDB *be = op->o_bd;
op->o_bd = bd;
- rc = ( bd->be_fetch )( op, ndn, oc, at, rw, e );
+ rc = bd->be_fetch( op, ndn, oc, at, rw, e );
op->o_bd = be;
}
relay_back_add_cb( &cb, op );
op->o_bd = bd;
- rc = ( bd->be_chk_referrals )( op, rs );
+ rc = bd->be_chk_referrals( op, rs );
op->o_bd = be;
if ( op->o_callback == &cb ) {
int
relay_back_operational( Operation *op, SlapReply *rs )
{
- relay_back_info *ri = (relay_back_info *)op->o_bd->be_private;
BackendDB *bd;
int rc = 1;
- bd = ri->ri_bd;
- if ( bd == NULL) {
- bd = select_backend( &op->o_req_ndn, 0, 1 );
- if ( bd == NULL ) {
- return 1;
- }
+ bd = relay_back_select_backend( op, rs, LDAP_SUCCESS, 0 );
+ /* FIXME: this test only works if there are no overlays, so
+ * it is nearly useless; if made stricter, no nested back-relays
+ * can be instantiated... too bad. */
+ if ( bd == NULL || bd == op->o_bd ) {
+ return 0;
}
if ( bd->be_operational ) {
relay_back_add_cb( &cb, op );
op->o_bd = bd;
- rc = ( bd->be_operational )( op, rs );
+ rc = bd->be_operational( op, rs );
op->o_bd = be;
if ( op->o_callback == &cb ) {
int
relay_back_has_subordinates( Operation *op, Entry *e, int *hasSubs )
{
- relay_back_info *ri = (relay_back_info *)op->o_bd->be_private;
+ SlapReply rs = { 0 };
BackendDB *bd;
int rc = 1;
- bd = ri->ri_bd;
- if ( bd == NULL) {
- bd = select_backend( &op->o_req_ndn, 0, 1 );
- if ( bd == NULL ) {
- return 1;
- }
+ bd = relay_back_select_backend( op, &rs, LDAP_SUCCESS, 0 );
+ /* FIXME: this test only works if there are no overlays, so
+ * it is nearly useless; if made stricter, no nested back-relays
+ * can be instantiated... too bad. */
+ if ( bd == NULL || bd == op->o_bd ) {
+ return 0;
}
if ( bd->be_has_subordinates ) {
BackendDB *be = op->o_bd;
op->o_bd = bd;
- rc = ( bd->be_has_subordinates )( op, e, hasSubs );
+ rc = bd->be_has_subordinates( op, e, hasSubs );
op->o_bd = be;
}
}
if ( bd->be_connection_init ) {
- return ( bd->be_connection_init )( bd, c );
+ return bd->be_connection_init( bd, c );
}
return 0;
relay_back_info *ri = (relay_back_info *)bd->be_private;
bd = ri->ri_bd;
- if ( bd == NULL) {
+ if ( bd == NULL ) {
return 0;
}
if ( bd->be_connection_destroy ) {
- return ( bd->be_connection_destroy )( bd, c );
+ return bd->be_connection_destroy( bd, c );
}
return 0;