]> git.sur5r.net Git - openldap/commitdiff
Propagate SLAPD_ABANDON results to to allow cleanup callbacks to run
authorHoward Chu <hyc@openldap.org>
Thu, 28 Apr 2005 18:49:24 +0000 (18:49 +0000)
committerHoward Chu <hyc@openldap.org>
Thu, 28 Apr 2005 18:49:24 +0000 (18:49 +0000)
servers/slapd/result.c

index 37a91b6837e6687bc7d21e2976f05c073e610521..aa90811c82b913348025cb73b082e5db5cf0682f 100644 (file)
@@ -327,6 +327,11 @@ send_ldap_response(
        int             rc = LDAP_SUCCESS;
        long    bytes;
 
+       if ( rs->sr_err == SLAPD_ABANDON ) {
+               rc = SLAPD_ABANDON;
+               goto clean2;
+       }
+
        if ( op->o_callback ) {
                int             first = 1;
                slap_callback   *sc = op->o_callback,
@@ -568,6 +573,10 @@ slap_send_ldap_result( Operation *op, SlapReply *rs )
 
        rs->sr_type = REP_RESULT;
 
+       /* Propagate Abandons so that cleanup callbacks can be processed */
+       if ( rs->sr_err == SLAPD_ABANDON )
+               goto abandon;
+
        assert( !LDAP_API_ERROR( rs->sr_err ));
 
        Debug( LDAP_DEBUG_TRACE,
@@ -631,6 +640,7 @@ slap_send_ldap_result( Operation *op, SlapReply *rs )
        rs->sr_tag = req2res( op->o_tag );
        rs->sr_msgid = (rs->sr_tag != LBER_SEQUENCE) ? op->o_msgid : 0;
 
+abandon:
        if ( send_ldap_response( op, rs ) == SLAP_CB_CONTINUE ) {
                if ( op->o_tag == LDAP_REQ_SEARCH ) {
                        char nbuf[64];