Commit 423c53d2 authored by Howard Chu's avatar Howard Chu
Browse files

Add fe_op_abandon, call it in connection_abandon()

parent dced3cca
......@@ -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 );
}
op->o_bd = frontendDB;
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;
}
......@@ -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 */
......
......@@ -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;
......
......@@ -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));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment