From: Willy Tarreau Date: Tue, 24 May 2022 14:22:24 +0000 (+0200) Subject: MEDIUM: stconn: remove SE_FL_RXBLK_SHUT X-Git-Tag: v2.6-dev12~64 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=676c8db13458671d4ee64489f884a72daecf3b80;p=thirdparty%2Fhaproxy.git MEDIUM: stconn: remove SE_FL_RXBLK_SHUT 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. --- diff --git a/dev/flags/flags.c b/dev/flags/flags.c index 515666cb04..5ce76e6b0c 100644 --- a/dev/flags/flags.c +++ b/dev/flags/flags.c @@ -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); diff --git a/include/haproxy/conn_stream-t.h b/include/haproxy/conn_stream-t.h index 3d1991647e..a29a18e287 100644 --- a/include/haproxy/conn_stream-t.h +++ b/include/haproxy/conn_stream-t.h @@ -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 */ diff --git a/include/haproxy/conn_stream.h b/include/haproxy/conn_stream.h index 3faaebc007..643d2bf99b 100644 --- a/include/haproxy/conn_stream.h +++ b/include/haproxy/conn_stream.h @@ -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) { diff --git a/src/conn_stream.c b/src/conn_stream.c index c27a0ad64f..85c3b82bad 100644 --- a/src/conn_stream.c +++ b/src/conn_stream.c @@ -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; diff --git a/src/http_ana.c b/src/http_ana.c index 08a76b2b04..6f09f2a201 100644 --- a/src/http_ana.c +++ b/src/http_ana.c @@ -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 */