From: Willy Tarreau Date: Wed, 25 May 2022 16:05:53 +0000 (+0200) Subject: CLEANUP: stconn: remove cs_tx_blocked() and cs_tx_endp_ready() X-Git-Tag: v2.6-dev12~53 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9f07b697ee8a2c9e20a64dce0a38182bd4827f52;p=thirdparty%2Fhaproxy.git CLEANUP: stconn: remove cs_tx_blocked() and cs_tx_endp_ready() These ones were used exactly once and together, in sc_is_send_allowed(). No need to give them confusing names, instead let's just put the flags, they're way more explicit, and drop the two functions. --- diff --git a/include/haproxy/conn_stream.h b/include/haproxy/conn_stream.h index 82f533ac7c..7f15dff130 100644 --- a/include/haproxy/conn_stream.h +++ b/include/haproxy/conn_stream.h @@ -373,18 +373,6 @@ static inline void sc_need_room(struct stconn *sc) sc->flags |= SC_FL_NEED_ROOM; } -/* Returns non-zero if the stream connector's Tx path is blocked */ -static inline int cs_tx_blocked(const struct stconn *cs) -{ - return !!sc_ep_test(cs, SE_FL_WAIT_DATA); -} - -/* Returns non-zero if the stream connector's endpoint is ready to transmit */ -static inline int cs_tx_endp_ready(const struct stconn *cs) -{ - return sc_ep_test(cs, SE_FL_WILL_CONSUME); -} - /* Report that a stream connector wants to get some data from the output buffer */ static inline void cs_want_get(struct stconn *cs) { diff --git a/include/haproxy/cs_utils.h b/include/haproxy/cs_utils.h index b53602cbf7..7efe60ed29 100644 --- a/include/haproxy/cs_utils.h +++ b/include/haproxy/cs_utils.h @@ -378,7 +378,7 @@ static inline int sc_is_send_allowed(const struct stconn *sc) if (oc->flags & CF_SHUTW) return 0; - return cs_tx_endp_ready(sc) && !cs_tx_blocked(sc); + return (sc_ep_get(sc) & (SE_FL_WAIT_DATA|SE_FL_WILL_CONSUME)) == SE_FL_WILL_CONSUME; } #endif /* _HAPROXY_CS_UTILS_H */