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.
This commit is contained in:
Willy Tarreau 2022-05-25 18:05:53 +02:00
parent 79cf6e1f15
commit 9f07b697ee
2 changed files with 1 additions and 13 deletions

View File

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

View File

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