]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: muxes: rename "get_first_cs" to "get_first_sc"
authorWilly Tarreau <w@1wt.eu>
Fri, 27 May 2022 09:00:59 +0000 (11:00 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 27 May 2022 17:33:35 +0000 (19:33 +0200)
This is renamed both in the mux_ops descriptor and the mux functions
themselves to accommodate the new type name.

include/haproxy/connection-t.h
include/haproxy/connection.h
src/mux_fcgi.c
src/mux_h1.c
src/mux_h2.c
src/mux_pt.c

index 1f12afb486e1ca8b1983c502b1d86715b94bf343..87941eb309296dbb78ce27b931993dab14b707a7 100644 (file)
@@ -397,7 +397,7 @@ struct mux_ops {
        void (*shutw)(struct stconn *cs, enum co_shw_mode);     /* shutw function */
 
        int (*attach)(struct connection *conn, struct sedesc *, struct session *sess); /* attach a stconn to an outgoing connection */
-       struct stconn *(*get_first_cs)(const struct connection *); /* retrieves any valid stconn from this connection */
+       struct stconn *(*get_first_sc)(const struct connection *); /* retrieves any valid stconn from this connection */
        void (*detach)(struct sedesc *); /* Detach an stconn from the stdesc from an outgoing connection, when the request is done */
        int (*show_fd)(struct buffer *, struct connection *); /* append some data about connection into chunk for "show fd"; returns non-zero if suspicious */
        int (*subscribe)(struct stconn *cs, int event_type,  struct wait_event *es); /* Subscribe <es> to events, such as "being able to send" */
index 8d99ca26f2a2a3539eb9e012a249840ea202cb1f..90b47b54b397f4156939cbfd683762722db41edb 100644 (file)
@@ -498,7 +498,7 @@ static inline int conn_install_mux(struct connection *conn, const struct mux_ops
  * connection for purposes like source binding or proxy protocol header
  * emission. In such cases, any stream connector is expected to be valid so the
  * mux is encouraged to return the first one it finds. If the connection has
- * no mux or the mux has no get_first_cs() method or the mux has no valid
+ * no mux or the mux has no get_first_sc() method or the mux has no valid
  * stream connector, NULL is returned. The output pointer is purposely marked
  * const to discourage the caller from modifying anything there.
  */
@@ -506,9 +506,9 @@ static inline struct stconn *conn_get_first_sc(const struct connection *conn)
 {
        BUG_ON(!conn || !conn->mux);
 
-       if (!conn->mux->get_first_cs)
+       if (!conn->mux->get_first_sc)
                return NULL;
-       return conn->mux->get_first_cs(conn);
+       return conn->mux->get_first_sc(conn);
 }
 
 int conn_update_alpn(struct connection *conn, const struct ist alpn, int force);
index f38a475fae63c82d19e978ad8f2f47b532f16211..70f9d023f4766272e0e068a07d554c89e76f2332 100644 (file)
@@ -3554,7 +3554,7 @@ static int fcgi_attach(struct connection *conn, struct sedesc *endp, struct sess
  * beneficial to scan backwards from the end to reduce the likeliness to find
  * orphans.
  */
-static struct stconn *fcgi_get_first_cs(const struct connection *conn)
+static struct stconn *fcgi_get_first_sc(const struct connection *conn)
 {
        struct fcgi_conn *fconn = conn->ctx;
        struct fcgi_strm *fstrm;
@@ -4280,7 +4280,7 @@ static const struct mux_ops mux_fcgi_ops = {
        .init          = fcgi_init,
        .wake          = fcgi_wake,
        .attach        = fcgi_attach,
-       .get_first_cs  = fcgi_get_first_cs,
+       .get_first_sc  = fcgi_get_first_sc,
        .detach        = fcgi_detach,
        .destroy       = fcgi_destroy,
        .avail_streams = fcgi_avail_streams,
index 1985006991cd88fcaf03ebe295f22db3619d8714..8be703b6d91973b405b1ccce6939b612f1f5a464 100644 (file)
@@ -3340,7 +3340,7 @@ static int h1_attach(struct connection *conn, struct sedesc *endp, struct sessio
 /* Retrieves a valid stream connector from this connection, or returns NULL.
  * For this mux, it's easy as we can only store a single stream connector.
  */
-static struct stconn *h1_get_first_cs(const struct connection *conn)
+static struct stconn *h1_get_first_sc(const struct connection *conn)
 {
        struct h1c *h1c = conn->ctx;
        struct h1s *h1s = h1c->h1s;
@@ -4205,7 +4205,7 @@ static const struct mux_ops mux_http_ops = {
        .init        = h1_init,
        .wake        = h1_wake,
        .attach      = h1_attach,
-       .get_first_cs = h1_get_first_cs,
+       .get_first_sc = h1_get_first_sc,
        .detach      = h1_detach,
        .destroy     = h1_destroy,
        .avail_streams = h1_avail_streams,
@@ -4231,7 +4231,7 @@ static const struct mux_ops mux_h1_ops = {
        .init        = h1_init,
        .wake        = h1_wake,
        .attach      = h1_attach,
-       .get_first_cs = h1_get_first_cs,
+       .get_first_sc = h1_get_first_sc,
        .detach      = h1_detach,
        .destroy     = h1_destroy,
        .avail_streams = h1_avail_streams,
index c405ea6c7338c62f886bafd84a9ede7062e14b5c..3ba4652d5b06f69f5dbc584854f8e6ba6e5e2d9f 100644 (file)
@@ -4320,7 +4320,7 @@ static int h2_attach(struct connection *conn, struct sedesc *endp, struct sessio
  * beneficial to scan backwards from the end to reduce the likeliness to find
  * orphans.
  */
-static struct stconn *h2_get_first_cs(const struct connection *conn)
+static struct stconn *h2_get_first_sc(const struct connection *conn)
 {
        struct h2c *h2c = conn->ctx;
        struct h2s *h2s;
@@ -6928,7 +6928,7 @@ static const struct mux_ops h2_ops = {
        .subscribe = h2_subscribe,
        .unsubscribe = h2_unsubscribe,
        .attach = h2_attach,
-       .get_first_cs = h2_get_first_cs,
+       .get_first_sc = h2_get_first_sc,
        .detach = h2_detach,
        .destroy = h2_destroy,
        .avail_streams = h2_avail_streams,
index 7e119a04876077386b02a52e814a36041a86688e..590e1660d8a9bda84fc44db0db92765047fe0b1f 100644 (file)
@@ -398,7 +398,7 @@ static int mux_pt_attach(struct connection *conn, struct sedesc *endp, struct se
 /* Retrieves a valid stream connector from this connection, or returns NULL.
  * For this mux, it's easy as we can only store a single stream connector.
  */
-static struct stconn *mux_pt_get_first_cs(const struct connection *conn)
+static struct stconn *mux_pt_get_first_sc(const struct connection *conn)
 {
        struct mux_pt_ctx *ctx = conn->ctx;
 
@@ -662,7 +662,7 @@ const struct mux_ops mux_tcp_ops = {
        .snd_pipe = mux_pt_snd_pipe,
 #endif
        .attach = mux_pt_attach,
-       .get_first_cs = mux_pt_get_first_cs,
+       .get_first_sc = mux_pt_get_first_sc,
        .detach = mux_pt_detach,
        .avail_streams = mux_pt_avail_streams,
        .used_streams = mux_pt_used_streams,
@@ -687,7 +687,7 @@ const struct mux_ops mux_pt_ops = {
        .snd_pipe = mux_pt_snd_pipe,
 #endif
        .attach = mux_pt_attach,
-       .get_first_cs = mux_pt_get_first_cs,
+       .get_first_sc = mux_pt_get_first_sc,
        .detach = mux_pt_detach,
        .avail_streams = mux_pt_avail_streams,
        .used_streams = mux_pt_used_streams,