From 417a31bb556246df62392e5e0954a82fb5407320 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Wed, 18 May 2022 17:51:19 +0200 Subject: [PATCH] CLEANUP: stconn: rename cs_conn_mux() to sc_mux_ops() This effectively returns the mux_ops from the connection when it exists on an stconn. --- include/haproxy/conn_stream.h | 8 ++++---- src/conn_stream.c | 4 ++-- src/stream.c | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/haproxy/conn_stream.h b/include/haproxy/conn_stream.h index 3d12b58c8..aa186b3b2 100644 --- a/include/haproxy/conn_stream.h +++ b/include/haproxy/conn_stream.h @@ -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); diff --git a/src/conn_stream.c b/src/conn_stream.c index 06b147343..b2c45f8e1 100644 --- a/src/conn_stream.c +++ b/src/conn_stream.c @@ -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); diff --git a/src/stream.c b/src/stream.c index 51e18d311..e8f9c9180 100644 --- a/src/stream.c +++ b/src/stream.c @@ -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;