]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: stream-int/conn-stream: Move si_conn_ready() in the conn-stream scope
authorChristopher Faulet <cfaulet@haproxy.com>
Thu, 31 Mar 2022 07:58:41 +0000 (09:58 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 13 Apr 2022 13:10:15 +0000 (15:10 +0200)
si_conn_ready() is renamed cs_conn_ready() and handle a conn-stream insted
of a stream-interface. The function is now in cs_utils.h.

include/haproxy/cs_utils.h
include/haproxy/stream_interface.h
src/cli.c

index bfee8fddd8b5a47b2801b95c617b515f7c77e700..bc864100e893fd0ac7029b00fae61ded97605db1 100644 (file)
@@ -108,6 +108,17 @@ static inline int cs_state_in(enum cs_state state, enum cs_state_bit mask)
        return !!(cs_state_bit(state) & mask);
 }
 
+/* Returns true if a connection is attached to the conn-stream <cs> and if this
+ * connection is ready.
+ */
+static inline int cs_conn_ready(struct conn_stream *cs)
+{
+       struct connection *conn = cs_conn(cs);
+
+       return conn && conn_ctrl_ready(conn) && conn_xprt_ready(conn);
+}
+
+
 /* Returns the source address of the conn-stream and, if not set, fallbacks on
  * the session for frontend CS and the server connection for the backend CS. It
  * returns a const address on success or NULL on failure.
index dbe11985e16c84635883b4d5937438a2e88e81e9..9aba8478c6e67b4ab17d1f67d8dca2463fedcf54 100644 (file)
@@ -127,16 +127,6 @@ static inline void si_applet_release(struct stream_interface *si)
                appctx->applet->release(appctx);
 }
 
-/* Returns true if a connection is attached to the stream interface <si> and
- * if this connection is ready.
- */
-static inline int si_conn_ready(struct stream_interface *si)
-{
-       struct connection *conn = cs_conn(si->cs);
-
-       return conn && conn_ctrl_ready(conn) && conn_xprt_ready(conn);
-}
-
 /* Returns non-zero if the stream interface's Rx path is blocked */
 static inline int si_rx_blocked(const struct stream_interface *si)
 {
index baea805e167bb55334c599963af67091f3d650d0..6039fb926f226b6ea1fb4b48f18d435e2e45772c 100644 (file)
--- a/src/cli.c
+++ b/src/cli.c
@@ -2753,7 +2753,7 @@ int pcli_wait_for_response(struct stream *s, struct channel *rep, int an_bit)
                /* only release our endpoint if we don't intend to reuse the
                 * connection.
                 */
-               if (!si_conn_ready(cs_si(s->csb))) {
+               if (!cs_conn_ready(s->csb)) {
                        s->srv_conn = NULL;
                        if (cs_reset_endp(s->csb) < 0) {
                                if (!s->conn_err_type)