]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: stconn: remove cs_tx_blocked() and cs_tx_endp_ready()
authorWilly Tarreau <w@1wt.eu>
Wed, 25 May 2022 16:05:53 +0000 (18:05 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 27 May 2022 17:33:35 +0000 (19:33 +0200)
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.

include/haproxy/conn_stream.h
include/haproxy/cs_utils.h

index 82f533ac7ca580f163621d2df1558a755788d95a..7f15dff130474157d43e98ac19c492045c543f07 100644 (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)
 {
index b53602cbf7b4b8f14f9cad2a7a25be4416e674aa..7efe60ed29e49c3ff0146585a124f540e23b6396 100644 (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 */