]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: connection: rename all occurrences of stconn "cs" to "sc"
authorWilly Tarreau <w@1wt.eu>
Fri, 27 May 2022 08:00:13 +0000 (10:00 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 27 May 2022 17:33:35 +0000 (19:33 +0200)
Function arguments and local variables called "cs" were renamed to "sc"
to avoid future confusion.

include/haproxy/connection-t.h
src/connection.c

index 87941eb309296dbb78ce27b931993dab14b707a7..5e107222df96e35ec5c6dfeec401ac1cd059407a 100644 (file)
@@ -389,19 +389,19 @@ struct xprt_ops {
 struct mux_ops {
        int  (*init)(struct connection *conn, struct proxy *prx, struct session *sess, struct buffer *input);  /* early initialization */
        int  (*wake)(struct connection *conn);        /* mux-layer callback to report activity, mandatory */
-       size_t (*rcv_buf)(struct stconn *cs, struct buffer *buf, size_t count, int flags); /* Called from the upper layer to get data */
-       size_t (*snd_buf)(struct stconn *cs, struct buffer *buf, size_t count, int flags); /* Called from the upper layer to send data */
-       int  (*rcv_pipe)(struct stconn *cs, struct pipe *pipe, unsigned int count); /* recv-to-pipe callback */
-       int  (*snd_pipe)(struct stconn *cs, struct pipe *pipe); /* send-to-pipe callback */
-       void (*shutr)(struct stconn *cs, enum co_shr_mode);     /* shutr function */
-       void (*shutw)(struct stconn *cs, enum co_shw_mode);     /* shutw function */
+       size_t (*rcv_buf)(struct stconn *sc, struct buffer *buf, size_t count, int flags); /* Called from the upper layer to get data */
+       size_t (*snd_buf)(struct stconn *sc, struct buffer *buf, size_t count, int flags); /* Called from the upper layer to send data */
+       int  (*rcv_pipe)(struct stconn *sc, struct pipe *pipe, unsigned int count); /* recv-to-pipe callback */
+       int  (*snd_pipe)(struct stconn *sc, struct pipe *pipe); /* send-to-pipe callback */
+       void (*shutr)(struct stconn *sc, enum co_shr_mode);     /* shutr function */
+       void (*shutw)(struct stconn *sc, 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_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" */
-       int (*unsubscribe)(struct stconn *cs, int event_type,  struct wait_event *es); /* Unsubscribe <es> from events */
+       int (*subscribe)(struct stconn *sc, int event_type,  struct wait_event *es); /* Subscribe <es> to events, such as "being able to send" */
+       int (*unsubscribe)(struct stconn *sc, int event_type,  struct wait_event *es); /* Unsubscribe <es> from events */
        int (*avail_streams)(struct connection *conn); /* Returns the number of streams still available for a connection */
        int (*avail_streams_bidi)(struct connection *conn); /* Returns the number of bidirectional streams still available for a connection */
        int (*avail_streams_uni)(struct connection *conn); /* Returns the number of unidirectional streams still available for a connection */
index 6bd238a63b84310a29b0d853f1ffa94c42c3738e..620ef97f7c643f2a3c3abdac9ecb4c0c62c34a6e 100644 (file)
@@ -61,7 +61,7 @@ int conn_create_mux(struct connection *conn)
 {
        if (conn_is_back(conn)) {
                struct server *srv;
-               struct stconn *cs = conn->ctx;
+               struct stconn *sc = conn->ctx;
                struct session *sess = conn->owner;
 
                if (conn->flags & CO_FL_ERROR)
@@ -91,7 +91,7 @@ int conn_create_mux(struct connection *conn)
                return 0;
 fail:
                /* let the upper layer know the connection failed */
-               cs->app_ops->wake(cs);
+               sc->app_ops->wake(sc);
                return -1;
        } else
                return conn_complete_session(conn);
@@ -1170,13 +1170,13 @@ int conn_send_proxy(struct connection *conn, unsigned int flag)
         * we've sent the whole proxy line. Otherwise we use connect().
         */
        if (conn->send_proxy_ofs) {
-               struct stconn *cs;
+               struct stconn *sc;
                int ret;
 
                /* If there is no mux attached to the connection, it means the
                 * connection context is a stream connector.
                 */
-               cs = conn->mux ? conn_get_first_sc(conn) : conn->ctx;
+               sc = conn->mux ? conn_get_first_sc(conn) : conn->ctx;
 
                /* The target server expects a PROXY line to be sent first.
                 * If the send_proxy_ofs is negative, it corresponds to the
@@ -1188,11 +1188,11 @@ int conn_send_proxy(struct connection *conn, unsigned int flag)
                 * send a LOCAL line (eg: for use with health checks).
                 */
 
-               if (cs && sc_strm(cs)) {
+               if (sc && sc_strm(sc)) {
                        ret = make_proxy_line(trash.area, trash.size,
                                              objt_server(conn->target),
-                                             sc_conn(sc_opposite(cs)),
-                                             __sc_strm(cs));
+                                             sc_conn(sc_opposite(sc)),
+                                             __sc_strm(sc));
                }
                else {
                        /* The target server expects a LOCAL line to be sent first. Retrieving