CLEANUP: stconn: rename cs_mux() to sc_mux_strm()
The function doesn't return a pointer to the mux but to the mux stream
(h1s, h2s etc). Let's adjust its name to reflect this. It's rarely used,
the name can be enlarged a bit. And of course s/cs/sc to accommodate for
the updated name.
diff --git a/include/haproxy/conn_stream.h b/include/haproxy/conn_stream.h
index 30ef61b..3d12b58 100644
--- a/include/haproxy/conn_stream.h
+++ b/include/haproxy/conn_stream.h
@@ -155,18 +155,18 @@
return (conn ? conn->mux : NULL);
}
-/* Returns the mux from a cs if the endpoint is a mux. Otherwise
- * NULL is returned. __cs_mux() returns the mux without any control
- * while cs_mux() check the endpoint type.
+/* Returns a pointer to the mux stream from a connector if the endpoint is
+ * a mux. Otherwise NULL is returned. __sc_mux_strm() returns the mux without
+ * any control while sc_mux_strm() checks the endpoint type.
*/
-static inline void *__cs_mux(const struct stconn *cs)
+static inline void *__sc_mux_strm(const struct stconn *cs)
{
return __cs_endp_target(cs);
}
-static inline struct appctx *cs_mux(const struct stconn *cs)
+static inline struct appctx *sc_mux_strm(const struct stconn *cs)
{
if (sc_ep_test(cs, SE_FL_T_MUX))
- return __cs_mux(cs);
+ return __sc_mux_strm(cs);
return NULL;
}
diff --git a/src/h3.c b/src/h3.c
index 0055ead..35c3784 100644
--- a/src/h3.c
+++ b/src/h3.c
@@ -863,7 +863,7 @@
size_t h3_snd_buf(struct stconn *cs, struct buffer *buf, size_t count, int flags)
{
size_t total = 0;
- struct qcs *qcs = __cs_mux(cs);
+ struct qcs *qcs = __sc_mux_strm(cs);
struct htx *htx;
enum htx_blk_type btype;
struct htx_blk *blk;
diff --git a/src/hq_interop.c b/src/hq_interop.c
index ae52970..972ddaf 100644
--- a/src/hq_interop.c
+++ b/src/hq_interop.c
@@ -96,7 +96,7 @@
static size_t hq_interop_snd_buf(struct stconn *cs, struct buffer *buf,
size_t count, int flags)
{
- struct qcs *qcs = __cs_mux(cs);
+ struct qcs *qcs = __sc_mux_strm(cs);
struct htx *htx;
enum htx_blk_type btype;
struct htx_blk *blk;
diff --git a/src/mux_fcgi.c b/src/mux_fcgi.c
index 311a603..5bde48b 100644
--- a/src/mux_fcgi.c
+++ b/src/mux_fcgi.c
@@ -3861,7 +3861,7 @@
/* shutr() called by the stream conector (mux_ops.shutr) */
static void fcgi_shutr(struct stconn *cs, enum co_shr_mode mode)
{
- struct fcgi_strm *fstrm = __cs_mux(cs);
+ struct fcgi_strm *fstrm = __sc_mux_strm(cs);
TRACE_POINT(FCGI_EV_STRM_SHUT, fstrm->fconn->conn, fstrm);
if (!mode)
@@ -3872,7 +3872,7 @@
/* shutw() called by the stream connector (mux_ops.shutw) */
static void fcgi_shutw(struct stconn *cs, enum co_shw_mode mode)
{
- struct fcgi_strm *fstrm = __cs_mux(cs);
+ struct fcgi_strm *fstrm = __sc_mux_strm(cs);
TRACE_POINT(FCGI_EV_STRM_SHUT, fstrm->fconn->conn, fstrm);
fcgi_do_shutw(fstrm);
@@ -3885,7 +3885,7 @@
*/
static int fcgi_subscribe(struct stconn *cs, int event_type, struct wait_event *es)
{
- struct fcgi_strm *fstrm = __cs_mux(cs);
+ struct fcgi_strm *fstrm = __sc_mux_strm(cs);
struct fcgi_conn *fconn = fstrm->fconn;
BUG_ON(event_type & ~(SUB_RETRY_SEND|SUB_RETRY_RECV));
@@ -3911,7 +3911,7 @@
*/
static int fcgi_unsubscribe(struct stconn *cs, int event_type, struct wait_event *es)
{
- struct fcgi_strm *fstrm = __cs_mux(cs);
+ struct fcgi_strm *fstrm = __sc_mux_strm(cs);
struct fcgi_conn *fconn = fstrm->fconn;
BUG_ON(event_type & ~(SUB_RETRY_SEND|SUB_RETRY_RECV));
@@ -3947,7 +3947,7 @@
*/
static size_t fcgi_rcv_buf(struct stconn *cs, struct buffer *buf, size_t count, int flags)
{
- struct fcgi_strm *fstrm = __cs_mux(cs);
+ struct fcgi_strm *fstrm = __sc_mux_strm(cs);
struct fcgi_conn *fconn = fstrm->fconn;
size_t ret = 0;
@@ -3991,7 +3991,7 @@
*/
static size_t fcgi_snd_buf(struct stconn *cs, struct buffer *buf, size_t count, int flags)
{
- struct fcgi_strm *fstrm = __cs_mux(cs);
+ struct fcgi_strm *fstrm = __sc_mux_strm(cs);
struct fcgi_conn *fconn = fstrm->fconn;
size_t total = 0;
size_t ret;
diff --git a/src/mux_h1.c b/src/mux_h1.c
index 0c107fa..2c3f118 100644
--- a/src/mux_h1.c
+++ b/src/mux_h1.c
@@ -3472,7 +3472,7 @@
static void h1_shutr(struct stconn *cs, enum co_shr_mode mode)
{
- struct h1s *h1s = __cs_mux(cs);
+ struct h1s *h1s = __sc_mux_strm(cs);
struct h1c *h1c;
if (!h1s)
@@ -3515,7 +3515,7 @@
static void h1_shutw(struct stconn *cs, enum co_shw_mode mode)
{
- struct h1s *h1s = __cs_mux(cs);
+ struct h1s *h1s = __sc_mux_strm(cs);
struct h1c *h1c;
if (!h1s)
@@ -3575,7 +3575,7 @@
*/
static int h1_unsubscribe(struct stconn *cs, int event_type, struct wait_event *es)
{
- struct h1s *h1s = __cs_mux(cs);
+ struct h1s *h1s = __sc_mux_strm(cs);
if (!h1s)
return 0;
@@ -3605,7 +3605,7 @@
*/
static int h1_subscribe(struct stconn *cs, int event_type, struct wait_event *es)
{
- struct h1s *h1s = __cs_mux(cs);
+ struct h1s *h1s = __sc_mux_strm(cs);
struct h1c *h1c;
if (!h1s)
@@ -3653,7 +3653,7 @@
*/
static size_t h1_rcv_buf(struct stconn *cs, struct buffer *buf, size_t count, int flags)
{
- struct h1s *h1s = __cs_mux(cs);
+ struct h1s *h1s = __sc_mux_strm(cs);
struct h1c *h1c = h1s->h1c;
struct h1m *h1m = (!(h1c->flags & H1C_F_IS_BACK) ? &h1s->req : &h1s->res);
size_t ret = 0;
@@ -3689,7 +3689,7 @@
/* Called from the upper layer, to send data */
static size_t h1_snd_buf(struct stconn *cs, struct buffer *buf, size_t count, int flags)
{
- struct h1s *h1s = __cs_mux(cs);
+ struct h1s *h1s = __sc_mux_strm(cs);
struct h1c *h1c;
size_t total = 0;
@@ -3754,7 +3754,7 @@
/* Send and get, using splicing */
static int h1_rcv_pipe(struct stconn *cs, struct pipe *pipe, unsigned int count)
{
- struct h1s *h1s = __cs_mux(cs);
+ struct h1s *h1s = __sc_mux_strm(cs);
struct h1c *h1c = h1s->h1c;
struct h1m *h1m = (!(h1c->flags & H1C_F_IS_BACK) ? &h1s->req : &h1s->res);
int ret = 0;
@@ -3824,7 +3824,7 @@
static int h1_snd_pipe(struct stconn *cs, struct pipe *pipe)
{
- struct h1s *h1s = __cs_mux(cs);
+ struct h1s *h1s = __sc_mux_strm(cs);
struct h1c *h1c = h1s->h1c;
struct h1m *h1m = (!(h1c->flags & H1C_F_IS_BACK) ? &h1s->res : &h1s->req);
int ret = 0;
diff --git a/src/mux_h2.c b/src/mux_h2.c
index dde18dc..4a3a701 100644
--- a/src/mux_h2.c
+++ b/src/mux_h2.c
@@ -4694,7 +4694,7 @@
/* shutr() called by the stream connector (mux_ops.shutr) */
static void h2_shutr(struct stconn *cs, enum co_shr_mode mode)
{
- struct h2s *h2s = __cs_mux(cs);
+ struct h2s *h2s = __sc_mux_strm(cs);
TRACE_ENTER(H2_EV_STRM_SHUT, h2s->h2c->conn, h2s);
if (mode)
@@ -4705,7 +4705,7 @@
/* shutw() called by the stream connector (mux_ops.shutw) */
static void h2_shutw(struct stconn *cs, enum co_shw_mode mode)
{
- struct h2s *h2s = __cs_mux(cs);
+ struct h2s *h2s = __sc_mux_strm(cs);
TRACE_ENTER(H2_EV_STRM_SHUT, h2s->h2c->conn, h2s);
h2_do_shutw(h2s);
@@ -6379,7 +6379,7 @@
*/
static int h2_subscribe(struct stconn *cs, int event_type, struct wait_event *es)
{
- struct h2s *h2s = __cs_mux(cs);
+ struct h2s *h2s = __sc_mux_strm(cs);
struct h2c *h2c = h2s->h2c;
TRACE_ENTER(H2_EV_STRM_SEND|H2_EV_STRM_RECV, h2c->conn, h2s);
@@ -6413,7 +6413,7 @@
*/
static int h2_unsubscribe(struct stconn *cs, int event_type, struct wait_event *es)
{
- struct h2s *h2s = __cs_mux(cs);
+ struct h2s *h2s = __sc_mux_strm(cs);
TRACE_ENTER(H2_EV_STRM_SEND|H2_EV_STRM_RECV, h2s->h2c->conn, h2s);
@@ -6453,7 +6453,7 @@
*/
static size_t h2_rcv_buf(struct stconn *cs, struct buffer *buf, size_t count, int flags)
{
- struct h2s *h2s = __cs_mux(cs);
+ struct h2s *h2s = __sc_mux_strm(cs);
struct h2c *h2c = h2s->h2c;
struct htx *h2s_htx = NULL;
struct htx *buf_htx = NULL;
@@ -6536,7 +6536,7 @@
*/
static size_t h2_snd_buf(struct stconn *cs, struct buffer *buf, size_t count, int flags)
{
- struct h2s *h2s = __cs_mux(cs);
+ struct h2s *h2s = __sc_mux_strm(cs);
size_t total = 0;
size_t ret;
struct htx *htx;
diff --git a/src/mux_quic.c b/src/mux_quic.c
index 9b37d05..a993a5a 100644
--- a/src/mux_quic.c
+++ b/src/mux_quic.c
@@ -1458,7 +1458,7 @@
static size_t qc_rcv_buf(struct stconn *cs, struct buffer *buf,
size_t count, int flags)
{
- struct qcs *qcs = __cs_mux(cs);
+ struct qcs *qcs = __sc_mux_strm(cs);
struct htx *qcs_htx = NULL;
struct htx *cs_htx = NULL;
size_t ret = 0;
@@ -1528,7 +1528,7 @@
static size_t qc_snd_buf(struct stconn *cs, struct buffer *buf,
size_t count, int flags)
{
- struct qcs *qcs = __cs_mux(cs);
+ struct qcs *qcs = __sc_mux_strm(cs);
size_t ret;
TRACE_ENTER(QMUX_EV_STRM_SEND, qcs->qcc->conn, qcs);
@@ -1548,7 +1548,7 @@
static int qc_subscribe(struct stconn *cs, int event_type,
struct wait_event *es)
{
- return qcs_subscribe(__cs_mux(cs), event_type, es);
+ return qcs_subscribe(__sc_mux_strm(cs), event_type, es);
}
/* Called from the upper layer, to unsubscribe <es> from events <event_type>.
@@ -1557,7 +1557,7 @@
*/
static int qc_unsubscribe(struct stconn *cs, int event_type, struct wait_event *es)
{
- struct qcs *qcs = __cs_mux(cs);
+ struct qcs *qcs = __sc_mux_strm(cs);
BUG_ON(event_type & ~(SUB_RETRY_SEND|SUB_RETRY_RECV));
BUG_ON(qcs->subs && qcs->subs != es);