]> git.sur5r.net Git - openldap/commitdiff
Import ITS#3448 fix from HEAD
authorHoward Chu <hyc@openldap.org>
Sat, 25 Dec 2004 20:26:25 +0000 (20:26 +0000)
committerHoward Chu <hyc@openldap.org>
Sat, 25 Dec 2004 20:26:25 +0000 (20:26 +0000)
servers/slapd/abandon.c
servers/slapd/connection.c
servers/slapd/proto-slap.h

index a70a2325c2c6686fbb631eecdb8606f489888a46..956f9aa5081f52057c0dfb598901f910cc335f9c 100644 (file)
@@ -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;
+}
index d7a87ee02725d06a39163bd85e0298830e617aee..550c4e05ccc22460b111169c907a44c31b3b7fab 100644 (file)
@@ -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 */
index 039c18879983c8f68093b0129e5efb691b15afe3..0817ef67a6a5b01e6cc0cd5397b05f9316025e22 100644 (file)
@@ -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));