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.
This commit is contained in:
Willy Tarreau 2022-05-24 16:22:24 +02:00
parent e7866b1ff7
commit 676c8db134
5 changed files with 4 additions and 24 deletions

View 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);

View 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 */

View 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)
{

View 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;

View 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 */