CLEANUP: connection: rename all occurrences of stconn "cs" to "sc"

Function arguments and local variables called "cs" were renamed to "sc"
to avoid future confusion.
This commit is contained in:
Willy Tarreau 2022-05-27 10:00:13 +02:00
parent bde14ad499
commit 61f5675cb4
2 changed files with 15 additions and 15 deletions

View 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 */

View 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