diff --git a/include/haproxy/cs_utils.h b/include/haproxy/cs_utils.h index bfee8fddd..bc864100e 100644 --- a/include/haproxy/cs_utils.h +++ b/include/haproxy/cs_utils.h @@ -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 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. diff --git a/include/haproxy/stream_interface.h b/include/haproxy/stream_interface.h index dbe11985e..9aba8478c 100644 --- a/include/haproxy/stream_interface.h +++ b/include/haproxy/stream_interface.h @@ -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 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) { diff --git a/src/cli.c b/src/cli.c index baea805e1..6039fb926 100644 --- 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)