]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: sock_raw: move calls to si_data_close upper
authorWilly Tarreau <wtarreau@exceliance.fr>
Mon, 6 Aug 2012 10:23:51 +0000 (12:23 +0200)
committerWilly Tarreau <w@1wt.eu>
Sun, 2 Sep 2012 19:53:10 +0000 (21:53 +0200)
Some users of si_data_close() need to have the fd still open,
so we must move the call before fd_delete().

src/sock_raw.c

index 1532e762d7b6aa4296a0407eefeb267ec00bc893..a50d77ad3097ebd887bd01a67058bc6671e3aa45 100644 (file)
@@ -710,6 +710,7 @@ static void sock_raw_shutw(struct stream_interface *si)
                /* we may have to close a pending connection, and mark the
                 * response buffer as shutr
                 */
+               si_data_close(si);
                fd_delete(si_fd(si));
                /* fall through */
        case SI_ST_CER:
@@ -717,7 +718,6 @@ static void sock_raw_shutw(struct stream_interface *si)
        case SI_ST_TAR:
                si->state = SI_ST_DIS;
 
-               si_data_close(si);
                if (si->release)
                        si->release(si);
        default:
@@ -748,11 +748,11 @@ static void sock_raw_shutr(struct stream_interface *si)
                return;
 
        if (si->ob->flags & BF_SHUTW) {
+               si_data_close(si);
                fd_delete(si_fd(si));
                si->state = SI_ST_DIS;
                si->exp = TICK_ETERNITY;
 
-               si_data_close(si);
                if (si->release)
                        si->release(si);
                return;