]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: stdesc: rename the stream connector ->cs field to ->sc
authorWilly Tarreau <w@1wt.eu>
Wed, 18 May 2022 05:43:52 +0000 (07:43 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 27 May 2022 17:33:34 +0000 (19:33 +0200)
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
include/haproxy/conn_stream-t.h
include/haproxy/mux_quic.h
src/conn_stream.c
src/mux_fcgi.c
src/mux_h1.c
src/mux_h2.c
src/mux_pt.c
src/mux_quic.c

index 8230955543d330fc44011c710736be19da0d2a2b..dcf69da2534560354285a70c28ebd626f00a1a22 100644 (file)
@@ -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 */
index 79393027d14e44ede729aeee3a281ec2fcb82328..c2f3f9c8d0c0ffb943bb538b6b493f519d13e185 100644 (file)
@@ -163,13 +163,13 @@ struct data_cb {
  *
  * <se>     is the stream endpoint, i.e. the mux stream or the appctx
  * <conn>   is the connection for connection-based streams
- * <cs>     is the stream connector we're attached to, or NULL
+ * <sc>     is the stream connector we're attached to, or NULL
  * <flags>  SE_FL_*
 */
 struct sedesc {
        void *se;
        struct connection *conn;
-       struct stconn *cs;
+       struct stconn *sc;
        unsigned int flags;
 };
 
index 4ea36e22792e4727513a2f883c7574fc518e4387..11da8194666f7f8f68ac06699653aa4f1c36af28 100644 (file)
@@ -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 */
index 490f8562f8400a0e019c5c94b06ee54038abc7fb..8b22c4a46e4421bffc69158293494d3f028ee1b5 100644 (file)
@@ -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;
 }
index 8dcb8efd2fc9b82f83d33de6f2fd522b48e14342..7a7ea25119c944e76f76e00d5a8721e90a5e09ea 100644 (file)
@@ -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;
 
index 74eeca1487d85b4087895a31ea848f72a7ea138b..f0f4372f5b061170b374473361138bdb188ab8f6 100644 (file)
@@ -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;
index f11863c2c01d915ee3d0cc16f9b5e8e26128b868..132ecb7e0c2999748e2e196b986fb3ad8cd641cf 100644 (file)
@@ -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;
index 4ae403df109eacf0ec619fd8bcd9959b2b6bdf39..fefccd9746e3ce71c79b8b04807b5deb516f8cfd 100644 (file)
@@ -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);
        }
 
index 0fcfe0385f2bfb0f480f3ae774d412b859ab97c6..e0036c09e05dff07aa83a7e97d7846aae595e8d9 100644 (file)
@@ -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);
                        }
                }
        }