]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: stconn: rename cs_conn_mux() to sc_mux_ops()
authorWilly Tarreau <w@1wt.eu>
Wed, 18 May 2022 15:51:19 +0000 (17:51 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 27 May 2022 17:33:34 +0000 (19:33 +0200)
This effectively returns the mux_ops from the connection when it exists
on an stconn.

include/haproxy/conn_stream.h
src/conn_stream.c
src/stream.c

index 3d12b58c82a9e2355570202ceb4f48263021494f..aa186b3b2638436ebfe9678e63cd7fbf5c0e38f6 100644 (file)
@@ -145,10 +145,10 @@ static inline struct connection *sc_conn(const struct stconn *cs)
        return NULL;
 }
 
-/* Returns the mux ops of the connection from a cs if the endpoint is a
+/* Returns the mux ops of the connection from an stconn if the endpoint is a
  * mux stream. Otherwise NULL is returned.
  */
-static inline const struct mux_ops *cs_conn_mux(const struct stconn *cs)
+static inline const struct mux_ops *sc_mux_ops(const struct stconn *cs)
 {
        const struct connection *conn = sc_conn(cs);
 
@@ -233,7 +233,7 @@ static inline void cs_conn_shutr(struct stconn *cs, enum co_shr_mode mode)
                return;
 
        /* clean data-layer shutdown */
-       mux = cs_conn_mux(cs);
+       mux = sc_mux_ops(cs);
        if (mux && mux->shutr)
                mux->shutr(cs, mode);
        sc_ep_set(cs, (mode == CO_SHR_DRAIN) ? SE_FL_SHRD : SE_FL_SHRR);
@@ -250,7 +250,7 @@ static inline void cs_conn_shutw(struct stconn *cs, enum co_shw_mode mode)
                return;
 
        /* clean data-layer shutdown */
-       mux = cs_conn_mux(cs);
+       mux = sc_mux_ops(cs);
        if (mux && mux->shutw)
                mux->shutw(cs, mode);
        sc_ep_set(cs, (mode == CO_SHW_NORMAL) ? SE_FL_SHWN : SE_FL_SHWS);
index 06b147343c04b391c79770121a376760b79f0c34..b2c45f8e1459c92c3aad4dd5284fa79cadf5167b 100644 (file)
@@ -1622,7 +1622,7 @@ int cs_conn_sync_recv(struct stconn *cs)
        if (!cs_state_in(cs->state, SC_SB_RDY|SC_SB_EST))
                return 0;
 
-       if (!cs_conn_mux(cs))
+       if (!sc_mux_ops(cs))
                return 0; // only stconns are supported
 
        if (cs->wait_event.events & SUB_RETRY_RECV)
@@ -1800,7 +1800,7 @@ void cs_conn_sync_send(struct stconn *cs)
        if (!cs_state_in(cs->state, SC_SB_CON|SC_SB_RDY|SC_SB_EST))
                return;
 
-       if (!cs_conn_mux(cs))
+       if (!sc_mux_ops(cs))
                return;
 
        cs_conn_send(cs);
index 51e18d3118daaa15ca7de888634bbfbdf7b777f2..e8f9c9180799d2b66056c431c7f9abab4212f451 100644 (file)
@@ -278,7 +278,7 @@ static void strm_trace(enum trace_level level, uint64_t mask, const struct trace
 int stream_upgrade_from_cs(struct stconn *cs, struct buffer *input)
 {
        struct stream *s = __sc_strm(cs);
-       const struct mux_ops *mux = cs_conn_mux(cs);
+       const struct mux_ops *mux = sc_mux_ops(cs);
 
        if (mux) {
                if (mux->flags & MX_FL_HTX)
@@ -466,7 +466,7 @@ struct stream *stream_new(struct session *sess, struct stconn *cs, struct buffer
        if (sc_ep_test(cs, SE_FL_WEBSOCKET))
                s->flags |= SF_WEBSOCKET;
        if (sc_conn(cs)) {
-               const struct mux_ops *mux = cs_conn_mux(cs);
+               const struct mux_ops *mux = sc_mux_ops(cs);
 
                if (mux && mux->flags & MX_FL_HTX)
                        s->flags |= SF_HTX;