From c105492bf5b84b8b55a5c03fdce70fdd85d456bd Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Wed, 18 May 2022 07:43:52 +0200 Subject: [PATCH] CLEANUP: stdesc: rename the stream connector ->cs field to ->sc This is a rename of this field. Most of the places were in muxes, but were already factored with the previous series adding *_sc(). --- include/haproxy/applet.h | 4 ++-- include/haproxy/conn_stream-t.h | 4 ++-- include/haproxy/mux_quic.h | 2 +- src/conn_stream.c | 10 +++++----- src/mux_fcgi.c | 6 +++--- src/mux_h1.c | 4 ++-- src/mux_h2.c | 6 +++--- src/mux_pt.c | 10 +++++----- src/mux_quic.c | 6 +++--- 9 files changed, 26 insertions(+), 26 deletions(-) diff --git a/include/haproxy/applet.h b/include/haproxy/applet.h index 823095554..dcf69da25 100644 --- a/include/haproxy/applet.h +++ b/include/haproxy/applet.h @@ -115,7 +115,7 @@ static inline void appctx_wakeup(struct appctx *appctx) /* returns the stream connector the appctx is attached to, via the sedesc */ static inline struct stconn *appctx_cs(const struct appctx *appctx) { - return appctx->sedesc->cs; + return appctx->sedesc->sc; } /* returns the stream the appctx is attached to. Note that a stream *must* @@ -123,7 +123,7 @@ static inline struct stconn *appctx_cs(const struct appctx *appctx) */ static inline struct stream *appctx_strm(const struct appctx *appctx) { - return __cs_strm(appctx->sedesc->cs); + return __cs_strm(appctx->sedesc->sc); } #endif /* _HAPROXY_APPLET_H */ diff --git a/include/haproxy/conn_stream-t.h b/include/haproxy/conn_stream-t.h index 79393027d..c2f3f9c8d 100644 --- a/include/haproxy/conn_stream-t.h +++ b/include/haproxy/conn_stream-t.h @@ -163,13 +163,13 @@ struct data_cb { * * is the stream endpoint, i.e. the mux stream or the appctx * is the connection for connection-based streams - * is the stream connector we're attached to, or NULL + * is the stream connector we're attached to, or NULL * SE_FL_* */ struct sedesc { void *se; struct connection *conn; - struct stconn *cs; + struct stconn *sc; unsigned int flags; }; diff --git a/include/haproxy/mux_quic.h b/include/haproxy/mux_quic.h index 4ea36e227..11da81946 100644 --- a/include/haproxy/mux_quic.h +++ b/include/haproxy/mux_quic.h @@ -118,7 +118,7 @@ static inline struct stconn *qc_attach_cs(struct qcs *qcs, struct buffer *buf) sess->t_handshake = 0; sess->t_idle = 0; - return qcs->endp->cs; + return qcs->endp->sc; } #endif /* USE_QUIC */ diff --git a/src/conn_stream.c b/src/conn_stream.c index 490f8562f..8b22c4a46 100644 --- a/src/conn_stream.c +++ b/src/conn_stream.c @@ -86,7 +86,7 @@ void sedesc_init(struct sedesc *sedesc) { sedesc->se = NULL; sedesc->conn = NULL; - sedesc->cs = NULL; + sedesc->sc = NULL; se_fl_setall(sedesc, SE_FL_NONE); } @@ -143,7 +143,7 @@ static struct stconn *cs_new(struct sedesc *sedesc) goto alloc_error; } cs->sedesc = sedesc; - sedesc->cs = cs; + sedesc->sc = cs; return cs; @@ -354,7 +354,7 @@ static void cs_detach_endp(struct stconn **csp) if (cs->wait_event.events != 0) conn->mux->unsubscribe(cs, cs->wait_event.events, &cs->wait_event); se_fl_set(sedesc, SE_FL_ORPHAN); - sedesc->cs = NULL; + sedesc->sc = NULL; cs->sedesc = NULL; conn->mux->detach(sedesc); } @@ -373,7 +373,7 @@ static void cs_detach_endp(struct stconn **csp) struct appctx *appctx = __cs_appctx(cs); sc_ep_set(cs, SE_FL_ORPHAN); - cs->sedesc->cs = NULL; + cs->sedesc->sc = NULL; cs->sedesc = NULL; appctx_shut(appctx); appctx_free(appctx); @@ -467,7 +467,7 @@ int cs_reset_endp(struct stconn *cs) cs_detach_endp(&cs); BUG_ON(cs->sedesc); cs->sedesc = new_endp; - cs->sedesc->cs = cs; + cs->sedesc->sc = cs; sc_ep_set(cs, SE_FL_DETACHED); return 0; } diff --git a/src/mux_fcgi.c b/src/mux_fcgi.c index 8dcb8efd2..7a7ea2511 100644 --- a/src/mux_fcgi.c +++ b/src/mux_fcgi.c @@ -372,7 +372,7 @@ static int fcgi_strm_send_abort(struct fcgi_conn *fconn, struct fcgi_strm *fstrm /* a dummy closed endpoint */ static const struct sedesc closed_ep = { - . cs = NULL, + .sc = NULL, .flags = SE_FL_DETACHED, }; @@ -425,7 +425,7 @@ static inline const char *fstrm_st_to_str(enum fcgi_strm_st st) /* returns the stconn associated to the FCGI stream */ static forceinline struct stconn *fcgi_strm_sc(const struct fcgi_strm *fstrm) { - return fstrm->endp->cs; + return fstrm->endp->sc; } @@ -3533,7 +3533,7 @@ static int fcgi_attach(struct connection *conn, struct sedesc *endp, struct sess struct fcgi_conn *fconn = conn->ctx; TRACE_ENTER(FCGI_EV_FSTRM_NEW, conn); - fstrm = fcgi_stconn_new(fconn, endp->cs, sess); + fstrm = fcgi_stconn_new(fconn, endp->sc, sess); if (!fstrm) goto err; diff --git a/src/mux_h1.c b/src/mux_h1.c index 74eeca148..f0f4372f5 100644 --- a/src/mux_h1.c +++ b/src/mux_h1.c @@ -367,7 +367,7 @@ static void h1_wake_stream_for_send(struct h1s *h1s); /* returns the stconn associated to the H1 stream */ static forceinline struct stconn *h1s_sc(const struct h1s *h1s) { - return h1s->endp->cs; + return h1s->endp->sc; } /* the H1 traces always expect that arg1, if non-null, is of type connection @@ -3320,7 +3320,7 @@ static int h1_attach(struct connection *conn, struct sedesc *endp, struct sessio goto err; } - h1s = h1c_bck_stream_new(h1c, endp->cs, sess); + h1s = h1c_bck_stream_new(h1c, endp->sc, sess); if (h1s == NULL) { TRACE_ERROR("h1s creation failure", H1_EV_STRM_NEW|H1_EV_STRM_END|H1_EV_STRM_ERR, conn); goto err; diff --git a/src/mux_h2.c b/src/mux_h2.c index f11863c2c..132ecb7e0 100644 --- a/src/mux_h2.c +++ b/src/mux_h2.c @@ -524,7 +524,7 @@ static int h2_settings_max_frame_size = 0; /* unset */ /* a dummy closed endpoint */ static const struct sedesc closed_ep = { - . cs = NULL, + .sc = NULL, .flags = SE_FL_DETACHED, }; @@ -615,7 +615,7 @@ static inline const char *h2s_st_to_str(enum h2_ss st) /* returns the stconn associated to the H2 stream */ static forceinline struct stconn *h2s_sc(const struct h2s *h2s) { - return h2s->endp->cs; + return h2s->endp->sc; } /* the H2 traces always expect that arg1, if non-null, is of type connection @@ -4301,7 +4301,7 @@ static int h2_attach(struct connection *conn, struct sedesc *endp, struct sessio struct h2c *h2c = conn->ctx; TRACE_ENTER(H2_EV_H2S_NEW, conn); - h2s = h2c_bck_stream_new(h2c, endp->cs, sess); + h2s = h2c_bck_stream_new(h2c, endp->sc, sess); if (!h2s) { TRACE_DEVEL("leaving on stream creation failure", H2_EV_H2S_NEW|H2_EV_H2S_ERR, conn); return -1; diff --git a/src/mux_pt.c b/src/mux_pt.c index 4ae403df1..fefccd974 100644 --- a/src/mux_pt.c +++ b/src/mux_pt.c @@ -94,7 +94,7 @@ INITCALL1(STG_REGISTER, trace_register_source, TRACE_SOURCE); /* returns the stconn associated to the stream */ static forceinline struct stconn *pt_sc(const struct mux_pt_ctx *pt) { - return pt->endp->cs; + return pt->endp->sc; } static inline void pt_trace_buf(const struct buffer *buf, size_t ofs, size_t len) @@ -386,12 +386,12 @@ static int mux_pt_attach(struct connection *conn, struct sedesc *endp, struct se TRACE_ENTER(PT_EV_STRM_NEW, conn); if (ctx->wait_event.events) conn->xprt->unsubscribe(ctx->conn, conn->xprt_ctx, SUB_RETRY_RECV, &ctx->wait_event); - if (cs_attach_mux(endp->cs, ctx, conn) < 0) + if (cs_attach_mux(endp->sc, ctx, conn) < 0) return -1; ctx->endp = endp; se_fl_set(ctx->endp, SE_FL_RCV_MORE); - TRACE_LEAVE(PT_EV_STRM_NEW, conn, endp->cs); + TRACE_LEAVE(PT_EV_STRM_NEW, conn, endp->sc); return 0; } @@ -428,7 +428,7 @@ static void mux_pt_detach(struct sedesc *endp) struct connection *conn = endp->conn; struct mux_pt_ctx *ctx; - TRACE_ENTER(PT_EV_STRM_END, conn, endp->cs); + TRACE_ENTER(PT_EV_STRM_END, conn, endp->sc); ctx = conn->ctx; @@ -438,7 +438,7 @@ static void mux_pt_detach(struct sedesc *endp) conn->xprt->subscribe(conn, conn->xprt_ctx, SUB_RETRY_RECV, &ctx->wait_event); } else { /* There's no session attached to that connection, destroy it */ - TRACE_DEVEL("killing dead connection", PT_EV_STRM_END, conn, endp->cs); + TRACE_DEVEL("killing dead connection", PT_EV_STRM_END, conn, endp->sc); mux_pt_destroy(ctx); } diff --git a/src/mux_quic.c b/src/mux_quic.c index 0fcfe0385..e0036c09e 100644 --- a/src/mux_quic.c +++ b/src/mux_quic.c @@ -1582,7 +1582,7 @@ static int qc_wake_some_streams(struct qcc *qcc) node = eb64_next(node)) { qcs = eb64_entry(node, struct qcs, by_id); - if (!qcs->endp || !qcs->endp->cs) + if (!qcs->endp || !qcs->endp->sc) continue; if (qcc->conn->flags & CO_FL_ERROR) { @@ -1594,8 +1594,8 @@ static int qc_wake_some_streams(struct qcc *qcc) qcs_notify_recv(qcs); qcs_notify_send(qcs); } - else if (qcs->endp->cs->data_cb->wake) { - qcs->endp->cs->data_cb->wake(qcs->endp->cs); + else if (qcs->endp->sc->data_cb->wake) { + qcs->endp->sc->data_cb->wake(qcs->endp->sc); } } }