]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MEDIUM: stconn: remove SE_FL_RXBLK_SHUT
authorWilly Tarreau <w@1wt.eu>
Tue, 24 May 2022 14:22:24 +0000 (16:22 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 27 May 2022 17:33:35 +0000 (19:33 +0200)
This flag is no more needed, it was only set on shut read to be tested
by cs_rx_blocked() which is now properly tested for shutr as well. The
cs_rx_blk_shut() calls were removed. Interestingly it allowed to remove
a special case in the L7 retry code.

This also ensures we will not risk to set it back on a new endpoint
after cs_reset_endp() via SE_FL_APP_MASK.

dev/flags/flags.c
include/haproxy/conn_stream-t.h
include/haproxy/conn_stream.h
src/conn_stream.c
src/http_ana.c

index 515666cb04db1fa26722474e18aa4dbc06470824..5ce76e6b0ca26b678cb7cca929f73cac14428b36 100644 (file)
@@ -187,7 +187,6 @@ void show_endp_flags(unsigned int f)
        SHOW_FLAG(f, SE_FL_RXBLK_CHAN);
        SHOW_FLAG(f, SE_FL_RXBLK_BUFF);
        SHOW_FLAG(f, SE_FL_RXBLK_ROOM);
-       SHOW_FLAG(f, SE_FL_RXBLK_SHUT);
        SHOW_FLAG(f, SE_FL_RXBLK_CONN);
        SHOW_FLAG(f, SE_FL_RX_WAIT_EP);
        SHOW_FLAG(f, SE_FL_WANT_GET);
index 3d1991647e45a404c5a658c695b645d8a5f33a5e..a29a18e28754292741905ec04f09ed0b1564c316 100644 (file)
@@ -78,10 +78,10 @@ enum se_flags {
        SE_FL_RXBLK_CHAN    = 0x04000000,  /* the channel doesn't want the CS to introduce data */
        SE_FL_RXBLK_BUFF    = 0x08000000,  /* CS waits for a buffer allocation to complete */
        SE_FL_RXBLK_ROOM    = 0x10000000,  /* CS waits for more buffer room to store incoming data */
-       SE_FL_RXBLK_SHUT    = 0x20000000,  /* input is now closed, nothing new will ever come */
+       /* unused             0x20000000,*/
        SE_FL_RXBLK_CONN    = 0x40000000,  /* other side is not connected */
-       SE_FL_RXBLK_ANY     = 0x7C000000,  /* any of the RXBLK flags above */
-       SE_FL_APP_MASK      = 0x7fe00000,  /* Mask for flags set by the app layer */
+       SE_FL_RXBLK_ANY     = 0x5C000000,  /* any of the RXBLK flags above */
+       SE_FL_APP_MASK      = 0x5fe00000,  /* Mask for flags set by the app layer */
 };
 
 /* stconn flags */
index 3faaebc0075981b092a756806460137c85ae7428..643d2bf99b0dafc8908ca600932ecfd9875f2815 100644 (file)
@@ -372,15 +372,6 @@ static inline void cs_rx_room_blk(struct stconn *cs)
        sc_ep_set(cs, SE_FL_RXBLK_ROOM);
 }
 
-/* The stream connector announces it will never put new data into the input
- * buffer and that it's not waiting for its endpoint to deliver anything else.
- * This function obviously doesn't have a _rdy equivalent.
- */
-static inline void cs_rx_shut_blk(struct stconn *cs)
-{
-       sc_ep_set(cs, SE_FL_RXBLK_SHUT);
-}
-
 /* Returns non-zero if the stream connector's Tx path is blocked */
 static inline int cs_tx_blocked(const struct stconn *cs)
 {
index c27a0ad64fe4737e5866eb5d7ba8a6e200e81400..85c3b82bade69b1ab16c4824b5e4fc15d694ba5e 100644 (file)
@@ -507,7 +507,6 @@ static void sc_app_shutr(struct stconn *cs)
 {
        struct channel *ic = sc_ic(cs);
 
-       cs_rx_shut_blk(cs);
        if (ic->flags & CF_SHUTR)
                return;
        ic->flags |= CF_SHUTR;
@@ -576,7 +575,6 @@ static void sc_app_shutw(struct stconn *cs)
                /* fall through */
        default:
                cs->flags &= ~SC_FL_NOLINGER;
-               cs_rx_shut_blk(cs);
                ic->flags |= CF_SHUTR;
                ic->rex = TICK_ETERNITY;
                __sc_strm(cs)->conn_exp = TICK_ETERNITY;
@@ -650,7 +648,6 @@ static void sc_app_shutr_conn(struct stconn *cs)
 
        BUG_ON(!sc_conn(cs));
 
-       cs_rx_shut_blk(cs);
        if (ic->flags & CF_SHUTR)
                return;
        ic->flags |= CF_SHUTR;
@@ -744,7 +741,6 @@ static void sc_app_shutw_conn(struct stconn *cs)
                /* fall through */
        default:
                cs->flags &= ~SC_FL_NOLINGER;
-               cs_rx_shut_blk(cs);
                ic->flags |= CF_SHUTR;
                ic->rex = TICK_ETERNITY;
                __sc_strm(cs)->conn_exp = TICK_ETERNITY;
@@ -876,7 +872,6 @@ static void sc_app_shutr_applet(struct stconn *cs)
 
        BUG_ON(!sc_appctx(cs));
 
-       cs_rx_shut_blk(cs);
        if (ic->flags & CF_SHUTR)
                return;
        ic->flags |= CF_SHUTR;
@@ -950,7 +945,6 @@ static void sc_app_shutw_applet(struct stconn *cs)
                /* fall through */
        default:
                cs->flags &= ~SC_FL_NOLINGER;
-               cs_rx_shut_blk(cs);
                ic->flags |= CF_SHUTR;
                ic->rex = TICK_ETERNITY;
                __sc_strm(cs)->conn_exp = TICK_ETERNITY;
@@ -1016,10 +1010,8 @@ void cs_update_rx(struct stconn *cs)
 {
        struct channel *ic = sc_ic(cs);
 
-       if (ic->flags & CF_SHUTR) {
-               cs_rx_shut_blk(cs);
+       if (ic->flags & CF_SHUTR)
                return;
-       }
 
        /* Read not closed, update FD status and timeout for reads */
        if (ic->flags & CF_DONT_READ)
@@ -1241,7 +1233,6 @@ static void sc_conn_read0(struct stconn *cs)
 
        BUG_ON(!sc_conn(cs));
 
-       cs_rx_shut_blk(cs);
        if (ic->flags & CF_SHUTR)
                return;
        ic->flags |= CF_SHUTR;
index 08a76b2b04fdcb81982c61d2cc783a47f346b0de..6f09f2a2017a6ce6451bf4667c724755e034d6b2 100644 (file)
@@ -1268,7 +1268,6 @@ static __inline int do_l7_retry(struct stream *s, struct stconn *cs)
                        s->flags |= SF_ERR_INTERNAL;
                return -1;
        }
-       sc_ep_clr(cs, SE_FL_RXBLK_SHUT);
 
        b_free(&req->buf);
        /* Swap the L7 buffer with the channel buffer */