]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: channel: don't unset CF_SHUTR_NOW after shutting down.
authorWilly Tarreau <w@1wt.eu>
Mon, 25 Mar 2019 17:35:05 +0000 (18:35 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 25 Mar 2019 17:35:05 +0000 (18:35 +0100)
This flag is set by the stream layer to request an abort, and results in
CF_SHUTR being set once the abort is performed. However by analogy with
the send side, the flag was removed once the CF_SHUTR flag was set, thus
we lose the information about the cause of the shutr. This is what creates
the confusion that sometimes arises between client and server aborts.

This patch makes sure we don't remove this flag anymore in this case.
All call places only use it to perform the shutr and already check it
against CF_SHUTR. So no condition needs to be updated to take this into
account.

Some later, more careful changes may consist in refining the conditions
where we report a client reset or a server reset to ignore SHUTR when
SHUTR_NOW is set so that we don't report such misleading information
anymore.

src/stream_interface.c

index d13d69588a8fc46ec8d792677edeac98c0534890..1e944f1f5e13783b3c7cfe06727e85d92c3f9f67 100644 (file)
@@ -168,7 +168,6 @@ static void stream_int_shutr(struct stream_interface *si)
        struct channel *ic = si_ic(si);
 
        si_rx_shut_blk(si);
-       ic->flags &= ~CF_SHUTR_NOW;
        if (ic->flags & CF_SHUTR)
                return;
        ic->flags |= CF_SHUTR;
@@ -237,7 +236,6 @@ static void stream_int_shutw(struct stream_interface *si)
        default:
                si->flags &= ~SI_FL_NOLINGER;
                si_rx_shut_blk(si);
-               ic->flags &= ~CF_SHUTR_NOW;
                ic->flags |= CF_SHUTR;
                ic->rex = TICK_ETERNITY;
                si->exp = TICK_ETERNITY;
@@ -899,7 +897,6 @@ static void stream_int_shutr_conn(struct stream_interface *si)
        struct channel *ic = si_ic(si);
 
        si_rx_shut_blk(si);
-       ic->flags &= ~CF_SHUTR_NOW;
        if (ic->flags & CF_SHUTR)
                return;
        ic->flags |= CF_SHUTR;
@@ -1006,7 +1003,6 @@ static void stream_int_shutw_conn(struct stream_interface *si)
        default:
                si->flags &= ~SI_FL_NOLINGER;
                si_rx_shut_blk(si);
-               ic->flags &= ~CF_SHUTR_NOW;
                ic->flags |= CF_SHUTR;
                ic->rex = TICK_ETERNITY;
                si->exp = TICK_ETERNITY;
@@ -1408,7 +1404,6 @@ static void stream_int_read0(struct stream_interface *si)
        struct channel *oc = si_oc(si);
 
        si_rx_shut_blk(si);
-       ic->flags &= ~CF_SHUTR_NOW;
        if (ic->flags & CF_SHUTR)
                return;
        ic->flags |= CF_SHUTR;
@@ -1493,7 +1488,6 @@ static void stream_int_shutr_applet(struct stream_interface *si)
        struct channel *ic = si_ic(si);
 
        si_rx_shut_blk(si);
-       ic->flags &= ~CF_SHUTR_NOW;
        if (ic->flags & CF_SHUTR)
                return;
        ic->flags |= CF_SHUTR;
@@ -1565,7 +1559,6 @@ static void stream_int_shutw_applet(struct stream_interface *si)
        default:
                si->flags &= ~SI_FL_NOLINGER;
                si_rx_shut_blk(si);
-               ic->flags &= ~CF_SHUTR_NOW;
                ic->flags |= CF_SHUTR;
                ic->rex = TICK_ETERNITY;
                si->exp = TICK_ETERNITY;