]> git.sur5r.net Git - openldap/commitdiff
ITS#7025 handle Abandon in backglue
authorHoward Chu <hyc@openldap.org>
Tue, 23 Aug 2011 20:48:59 +0000 (13:48 -0700)
committerHoward Chu <hyc@openldap.org>
Tue, 23 Aug 2011 20:48:59 +0000 (13:48 -0700)
servers/slapd/backglue.c

index 31afe2fff471ccf3320df8ef012a0e3d2e52e916..af46e71c72e11dd2849476fb38f88eef139efaa0 100644 (file)
@@ -258,6 +258,30 @@ glue_op_func ( Operation *op, SlapReply *rs )
        return rc;
 }
 
+static int
+glue_op_abandon( Operation *op, SlapReply *rs )
+{
+       slap_overinst   *on = (slap_overinst *)op->o_bd->bd_info;
+       glueinfo                *gi = (glueinfo *)on->on_bi.bi_private;
+       BackendDB *b0 = op->o_bd;
+       BackendInfo *bi0 = op->o_bd->bd_info;
+       int i;
+
+       b0->bd_info = on->on_info->oi_orig;
+
+       for (i = gi->gi_nodes-1; i >= 0; i--) {
+               assert( gi->gi_n[i].gn_be->be_nsuffix != NULL );
+               op->o_bd = gi->gi_n[i].gn_be;
+               if ( op->o_bd == b0 )
+                       continue;
+               if ( op->o_bd->bd_info->bi_op_abandon )
+                       op->o_bd->bd_info->bi_op_abandon( op, rs );
+       }
+       op->o_bd = b0;
+       op->o_bd->bd_info = bi0;
+       return SLAP_CB_CONTINUE;
+}
+
 static int
 glue_response ( Operation *op, SlapReply *rs )
 {
@@ -1510,6 +1534,7 @@ glue_sub_init()
        glue.on_bi.bi_op_modrdn = glue_op_func;
        glue.on_bi.bi_op_add = glue_op_func;
        glue.on_bi.bi_op_delete = glue_op_func;
+       glue.on_bi.bi_op_abandon = glue_op_abandon;
        glue.on_bi.bi_extended = glue_op_func;
 
        glue.on_bi.bi_chk_referrals = glue_chk_referrals;