From 6d4238c2ea4ac4023fc8616e8e8cf46eb22a43cb Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Sat, 25 Dec 2004 20:26:25 +0000 Subject: [PATCH] Import ITS#3448 fix from HEAD --- servers/slapd/abandon.c | 19 +++++++++++++++---- servers/slapd/connection.c | 13 ++++++++++--- servers/slapd/proto-slap.h | 1 + 3 files changed, 26 insertions(+), 7 deletions(-) diff --git a/servers/slapd/abandon.c b/servers/slapd/abandon.c index a70a2325c2..956f9aa508 100644 --- a/servers/slapd/abandon.c +++ b/servers/slapd/abandon.c @@ -114,11 +114,8 @@ do_abandon( Operation *op, SlapReply *rs ) done: op->orn_msgid = id; - for ( i = 0; i < nbackends; i++ ) { - op->o_bd = &backends[i]; - if( op->o_bd->be_abandon ) op->o_bd->be_abandon( op, rs ); - } + fe_op_abandon( op, rs ); ldap_pvt_thread_mutex_unlock( &op->o_conn->c_mutex ); @@ -132,3 +129,17 @@ done: #endif return LDAP_SUCCESS; } + +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 ) { + (void)op->o_bd->be_abandon( op, rs ); + } + } + + return LDAP_SUCCESS; +} diff --git a/servers/slapd/connection.c b/servers/slapd/connection.c index d7a87ee027..550c4e05cc 100644 --- a/servers/slapd/connection.c +++ b/servers/slapd/connection.c @@ -772,10 +772,17 @@ static void connection_abandon( Connection *c ) { /* c_mutex must be locked by caller */ - Operation *o; - - LDAP_STAILQ_FOREACH(o, &c->c_ops, o_next) { + Operation *o, *next, op = {0}; + SlapReply rs = {0}; + + op.o_conn = c; + op.o_connid = c->c_connid; + 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; + fe_op_abandon( &op, &rs ); } /* remove pending operations */ diff --git a/servers/slapd/proto-slap.h b/servers/slapd/proto-slap.h index 039c188799..0817ef67a6 100644 --- a/servers/slapd/proto-slap.h +++ b/servers/slapd/proto-slap.h @@ -1294,6 +1294,7 @@ LDAP_SLAPD_V (struct berval) NoAttrs; * operations */ LDAP_SLAPD_F (int) do_abandon LDAP_P((Operation *op, SlapReply *rs)); +LDAP_SLAPD_F (int) fe_op_abandon LDAP_P((Operation *op, SlapReply *rs)); LDAP_SLAPD_F (int) do_add LDAP_P((Operation *op, SlapReply *rs)); LDAP_SLAPD_F (int) do_bind LDAP_P((Operation *op, SlapReply *rs)); LDAP_SLAPD_F (int) do_compare LDAP_P((Operation *op, SlapReply *rs)); -- 2.47.2