]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: conn_stream: rename the cs_endpoint's target to "se"
authorWilly Tarreau <w@1wt.eu>
Mon, 16 May 2022 15:29:42 +0000 (17:29 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 27 May 2022 17:33:34 +0000 (19:33 +0200)
That's the "stream endpoint" pointer. Let's change it now while it's
not much spread. The function __cs_endp_target() wasn't yet renamed
because that will change more globally soon.

include/haproxy/conn_stream-t.h
include/haproxy/conn_stream.h
include/haproxy/mux_quic.h
src/applet.c
src/conn_stream.c
src/mux_fcgi.c
src/mux_h1.c
src/mux_h2.c
src/mux_pt.c
src/mux_quic.c
src/stream.c

index a6d52ff176bc3e4a1f376094244f7760b86d27b6..88964f6923875a2c574a3c1a6d3f02a243239ca7 100644 (file)
@@ -157,13 +157,13 @@ struct data_cb {
  * transfers the whole responsibility to the mux/applet and eventually create a
  * new cs-endpoint (for instance on connection retries).
  *
- * <target> is the mux or the appctx
+ * <se>     is the stream endpoint, i.e. the mux stream or the appctx
  * <conn>   is the connection for connection-based streams
  * <cs>     is the conn_stream we're attached to, or NULL
  * <flags>  SE_FL_*
 */
 struct cs_endpoint {
-       void *target;
+       void *se;
        struct connection *conn;
        struct conn_stream *cs;
        unsigned int flags;
index f79feea512856e7fc6389d0e8072c2a852564a30..b27bb824c6372828c7ceaf579f1faf2579d09b1d 100644 (file)
@@ -127,7 +127,7 @@ static forceinline uint sc_ep_get(const struct conn_stream *sc)
 /* Returns the endpoint target without any control */
 static inline void *__cs_endp_target(const struct conn_stream *cs)
 {
-       return cs->endp->target;
+       return cs->endp->se;
 }
 
 /* Returns the connection from a cs if the endpoint is a mux stream. Otherwise
index fc7f98611dead6055ec88aade166a3c0334cc6dc..31055e10c5ee440c3279c70692835fbceed1507b 100644 (file)
@@ -100,8 +100,8 @@ static inline struct conn_stream *qc_attach_cs(struct qcs *qcs, struct buffer *b
        if (!qcs->endp)
                return NULL;
 
-       qcs->endp->target = qcs;
-       qcs->endp->conn   = qcc->conn;
+       qcs->endp->se   = qcs;
+       qcs->endp->conn = qcc->conn;
        se_fl_set(qcs->endp, SE_FL_T_MUX | SE_FL_ORPHAN | SE_FL_NOT_FIRST);
 
        /* TODO duplicated from mux_h2 */
index c19749e0b2e6c114c1c610303e713a902afde0c4..db493f3c38f4f38803a6f209a9cbacdcbe4d3063 100644 (file)
@@ -50,7 +50,7 @@ struct appctx *appctx_new(struct applet *applet, struct cs_endpoint *endp, unsig
                endp = cs_endpoint_new();
                if (!endp)
                        goto fail_endp;
-               endp->target = appctx;
+               endp->se = appctx;
                se_fl_set(endp, SE_FL_T_APPLET | SE_FL_ORPHAN);
        }
        appctx->endp = endp;
index 5fe04c48f0371b9a8a57fda60297258f74622281..a99841a10f76c028d1417aec0f04a1767a3067ca 100644 (file)
@@ -84,7 +84,7 @@ struct data_cb cs_data_applet_cb = {
 /* Initializes an endpoint */
 void cs_endpoint_init(struct cs_endpoint *endp)
 {
-       endp->target = NULL;
+       endp->se = NULL;
        endp->conn = NULL;
        endp->cs = NULL;
        se_fl_setall(endp, SE_FL_NONE);
@@ -243,11 +243,11 @@ static void cs_free_cond(struct conn_stream **csp)
  * -1 on error and 0 on sucess. SE_FL_DETACHED flag is removed. This function is
  * called from a mux when it is attached to a stream or a health-check.
  */
-int cs_attach_mux(struct conn_stream *cs, void *target, void *ctx)
+int cs_attach_mux(struct conn_stream *cs, void *endp, void *ctx)
 {
        struct connection *conn = ctx;
 
-       cs->endp->target = target;
+       cs->endp->se     = endp;
        cs->endp->conn   = ctx;
        sc_ep_set(cs, SE_FL_T_MUX);
        sc_ep_clr(cs, SE_FL_DETACHED);
@@ -286,9 +286,9 @@ int cs_attach_mux(struct conn_stream *cs, void *target, void *ctx)
  * removed. This function is called by a stream when a backend applet is
  * registered.
  */
-static void cs_attach_applet(struct conn_stream *cs, void *target)
+static void cs_attach_applet(struct conn_stream *cs, void *endp)
 {
-       cs->endp->target = target;
+       cs->endp->se = endp;
        sc_ep_set(cs, SE_FL_T_APPLET);
        sc_ep_clr(cs, SE_FL_DETACHED);
        if (cs_strm(cs)) {
@@ -380,7 +380,7 @@ static void cs_detach_endp(struct conn_stream **csp)
 
        if (cs->endp) {
                /* the cs is the only one one the endpoint */
-               cs->endp->target = NULL;
+               cs->endp->se     = NULL;
                cs->endp->conn   = NULL;
                sc_ep_clr(cs, ~SE_FL_APP_MASK);
                sc_ep_set(cs, SE_FL_DETACHED);
index 8a751695708638eb66f747ed5fe54de1e236c60e..2c4e4aa995c6543f735a5fbb523f42991b5a751f 100644 (file)
@@ -3583,7 +3583,7 @@ static void fcgi_destroy(void *ctx)
  */
 static void fcgi_detach(struct cs_endpoint *endp)
 {
-       struct fcgi_strm *fstrm = endp->target;
+       struct fcgi_strm *fstrm = endp->se;
        struct fcgi_conn *fconn;
        struct session *sess;
 
index 3caee7c82a221fde80d7bf4c5c32270d5df96fff..e6ef8862493bf9f93a95284180283d0e68c7797f 100644 (file)
@@ -821,7 +821,7 @@ static struct h1s *h1c_frt_stream_new(struct h1c *h1c, struct conn_stream *cs, s
                h1s->endp = cs_endpoint_new();
                if (!h1s->endp)
                        goto fail;
-               h1s->endp->target = h1s;
+               h1s->endp->se     = h1s;
                h1s->endp->conn   = h1c->conn;
                se_fl_set(h1s->endp, SE_FL_T_MUX | SE_FL_ORPHAN);
        }
@@ -3359,7 +3359,7 @@ static void h1_destroy(void *ctx)
  */
 static void h1_detach(struct cs_endpoint *endp)
 {
-       struct h1s *h1s = endp->target;
+       struct h1s *h1s = endp->se;
        struct h1c *h1c;
        struct session *sess;
        int is_not_first;
index 935d611250e089e0584e50f3d6bc50f22794e61b..ffa54d284fb1487171bcde432ab6aeab114a1528 100644 (file)
@@ -1612,7 +1612,7 @@ static struct h2s *h2c_frt_stream_new(struct h2c *h2c, int id, struct buffer *in
        h2s->endp = cs_endpoint_new();
        if (!h2s->endp)
                goto out_close;
-       h2s->endp->target = h2s;
+       h2s->endp->se     = h2s;
        h2s->endp->conn   = h2c->conn;
        se_fl_set(h2s->endp, SE_FL_T_MUX | SE_FL_ORPHAN | SE_FL_NOT_FIRST);
 
@@ -4370,7 +4370,7 @@ static void h2_destroy(void *ctx)
  */
 static void h2_detach(struct cs_endpoint *endp)
 {
-       struct h2s *h2s = endp->target;
+       struct h2s *h2s = endp->se;
        struct h2c *h2c;
        struct session *sess;
 
index e93c2d65e7e738025908fdeec0904af4a6a0955c..8750facae9489ec7198369a5786376a96493107d 100644 (file)
@@ -298,7 +298,7 @@ static int mux_pt_init(struct connection *conn, struct proxy *prx, struct sessio
                        TRACE_ERROR("CS allocation failure", PT_EV_STRM_NEW|PT_EV_STRM_END|PT_EV_STRM_ERR, conn);
                        goto fail_free_ctx;
                }
-               ctx->endp->target = ctx;
+               ctx->endp->se     = ctx;
                ctx->endp->conn   = conn;
                se_fl_set(ctx->endp, SE_FL_T_MUX | SE_FL_ORPHAN);
 
index 878b44cc8a2129a6bf7fb33ae59ba0354e7cc88c..8e9bda99b1fde2f0bdd5ba21ed2a20a931a28c5e 100644 (file)
@@ -1424,7 +1424,7 @@ static void qc_destroy(void *ctx)
 
 static void qc_detach(struct cs_endpoint *endp)
 {
-       struct qcs *qcs = endp->target;
+       struct qcs *qcs = endp->se;
        struct qcc *qcc = qcs->qcc;
 
        TRACE_ENTER(QMUX_EV_STRM_END, qcc->conn, qcs);
index d5e2d8ad29c5ec68bc2517e6bf5ce8ef108cf04e..91ceeb4e4a1b74b9fa1da8885ca220501505b13a 100644 (file)
@@ -3308,7 +3308,7 @@ static int stats_dump_full_strm_to_buffer(struct conn_stream *cs, struct stream
                chunk_appendf(&trash, "  csf=%p flags=0x%08x state=%s endp=%s,%p,0x%08x sub=%d\n",
                              csf, csf->flags, cs_state_str(csf->state),
                              (sc_ep_test(csf, SE_FL_T_MUX) ? "CONN" : (sc_ep_test(csf, SE_FL_T_APPLET) ? "APPCTX" : "NONE")),
-                             csf->endp->target, sc_ep_get(csf), csf->wait_event.events);
+                             csf->endp->se, sc_ep_get(csf), csf->wait_event.events);
 
                if ((conn = cs_conn(csf)) != NULL) {
                        chunk_appendf(&trash,
@@ -3347,7 +3347,7 @@ static int stats_dump_full_strm_to_buffer(struct conn_stream *cs, struct stream
                chunk_appendf(&trash, "  csb=%p flags=0x%08x state=%s endp=%s,%p,0x%08x sub=%d\n",
                              csb, csb->flags, cs_state_str(csb->state),
                              (sc_ep_test(csb, SE_FL_T_MUX) ? "CONN" : (sc_ep_test(csb, SE_FL_T_APPLET) ? "APPCTX" : "NONE")),
-                             csb->endp->target, sc_ep_get(csb), csb->wait_event.events);
+                             csb->endp->se, sc_ep_get(csb), csb->wait_event.events);
 
                if ((conn = cs_conn(csb)) != NULL) {
                        chunk_appendf(&trash,