Add fe_op_abandon, call it in connection_abandon()

This commit is contained in:
Howard Chu 2004-12-09 21:17:29 +00:00
parent dced3cca04
commit 423c53d267
4 changed files with 22 additions and 14 deletions

View File

@ -93,20 +93,24 @@ do_abandon( Operation *op, SlapReply *rs )
done:
op->orn_msgid = id;
if ( frontendDB->be_abandon ) {
op->o_bd = frontendDB;
frontendDB->be_abandon( op, rs );
}
for ( i = 0; i < nbackends; i++ ) {
op->o_bd = &backends[i];
if( op->o_bd->be_abandon ) op->o_bd->be_abandon( op, rs );
}
rs->sr_err = frontendDB->be_abandon( op, rs );
ldap_pvt_thread_mutex_unlock( &op->o_conn->c_mutex );
Debug( LDAP_DEBUG_TRACE, "do_abandon: op=%ld %sfound\n",
(long) id, o ? "" : "not ", 0 );
return LDAP_SUCCESS;
return rs->sr_err;
}
int
fe_op_abandon( Operation *op, SlapReply *rs )
{
int i;
for ( i = 0; i < nbackends; i++ ) {
op->o_bd = &backends[i];
if( op->o_bd->be_abandon ) op->o_bd->be_abandon( op, rs );
}
return LDAP_SUCCESS;
}

View File

@ -710,10 +710,15 @@ static void connection_abandon( Connection *c )
{
/* c_mutex must be locked by caller */
Operation *o;
Operation *o, *next, op = {0};
SlapReply rs = {0};
LDAP_STAILQ_FOREACH(o, &c->c_ops, o_next) {
op.o_tag = LDAP_REQ_ABANDON;
for ( o = LDAP_STAILQ_FIRST( &c->c_ops ); o; o=next ) {
next = LDAP_STAILQ_NEXT( o, o_next );
op.orn_msgid = o->o_msgid;
o->o_abandon = 1;
frontendDB->be_abandon( &op, &rs );
}
/* remove pending operations */

View File

@ -83,6 +83,7 @@ frontend_init( void )
frontendDB->bd_info->bi_controls = slap_known_controls;
/* calls */
frontendDB->bd_info->bi_op_abandon = fe_op_abandon;
frontendDB->bd_info->bi_op_add = fe_op_add;
frontendDB->bd_info->bi_op_bind = fe_op_bind;
frontendDB->bd_info->bi_op_compare = fe_op_compare;

View File

@ -1410,9 +1410,7 @@ LDAP_SLAPD_F (int) do_extended LDAP_P((Operation *op, SlapReply *rs));
/*
* frontend operations
*/
#if 0
LDAP_SLAPD_F (int) fe_op_abandon LDAP_P((Operation *op, SlapReply *rs));
#endif
LDAP_SLAPD_F (int) fe_op_add LDAP_P((Operation *op, SlapReply *rs));
LDAP_SLAPD_F (int) fe_op_bind LDAP_P((Operation *op, SlapReply *rs));
LDAP_SLAPD_F (int) fe_op_compare LDAP_P((Operation *op, SlapReply *rs));