]> git.sur5r.net Git - openldap/commitdiff
ITS#7062 call response callbacks even if connection was dropped
authorHoward Chu <hyc@openldap.org>
Tue, 1 Nov 2011 18:02:00 +0000 (11:02 -0700)
committerHoward Chu <hyc@openldap.org>
Tue, 1 Nov 2011 18:02:00 +0000 (11:02 -0700)
servers/slapd/result.c

index 27a9db887b09bc598c38c0a0e3476e0e1b0ea854..13a70ed9e9c97055e0e8fc98a949cda2b33712a8 100644 (file)
@@ -570,7 +570,8 @@ send_ldap_response(
        int             rc = LDAP_SUCCESS;
        long    bytes;
 
-       if (( rs->sr_err == SLAPD_ABANDON || op->o_abandon ) && !op->o_cancel ) {
+       /* op was actually aborted, bypass everything if client didn't Cancel */
+       if (( rs->sr_err == SLAPD_ABANDON ) && !op->o_cancel ) {
                rc = SLAPD_ABANDON;
                goto clean2;
        }
@@ -582,6 +583,12 @@ send_ldap_response(
                }
        }
 
+       /* op completed, connection aborted, bypass sending response */
+       if ( op->o_abandon && !op->o_cancel ) {
+               rc = SLAPD_ABANDON;
+               goto clean2;
+       }
+
 #ifdef LDAP_CONNECTIONLESS
        if (op->o_conn && op->o_conn->c_is_udp)
                ber = op->o_res_ber;