From d137353ae38cc37ca0445a3f00b1d7e8609fe5d7 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Fri, 27 May 2022 11:00:59 +0200 Subject: [PATCH] CLEANUP: muxes: rename "get_first_cs" to "get_first_sc" 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 | 2 +- include/haproxy/connection.h | 6 +++--- src/mux_fcgi.c | 4 ++-- src/mux_h1.c | 6 +++--- src/mux_h2.c | 4 ++-- src/mux_pt.c | 6 +++--- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/include/haproxy/connection-t.h b/include/haproxy/connection-t.h index 1f12afb48..87941eb30 100644 --- a/include/haproxy/connection-t.h +++ b/include/haproxy/connection-t.h @@ -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 to events, such as "being able to send" */ diff --git a/include/haproxy/connection.h b/include/haproxy/connection.h index 8d99ca26f..90b47b54b 100644 --- a/include/haproxy/connection.h +++ b/include/haproxy/connection.h @@ -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); diff --git a/src/mux_fcgi.c b/src/mux_fcgi.c index f38a475fa..70f9d023f 100644 --- a/src/mux_fcgi.c +++ b/src/mux_fcgi.c @@ -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, diff --git a/src/mux_h1.c b/src/mux_h1.c index 198500699..8be703b6d 100644 --- a/src/mux_h1.c +++ b/src/mux_h1.c @@ -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, diff --git a/src/mux_h2.c b/src/mux_h2.c index c405ea6c7..3ba4652d5 100644 --- a/src/mux_h2.c +++ b/src/mux_h2.c @@ -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, diff --git a/src/mux_pt.c b/src/mux_pt.c index 7e119a048..590e1660d 100644 --- a/src/mux_pt.c +++ b/src/mux_pt.c @@ -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,