]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: stconn: rename cs_conn() to sc_conn()
authorWilly Tarreau <w@1wt.eu>
Wed, 18 May 2022 14:23:22 +0000 (16:23 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 27 May 2022 17:33:34 +0000 (19:33 +0200)
It's mostly used from upper layers. Both the checked and unchecked
functions were updated, or ~150 entries.

16 files changed:
include/haproxy/conn_stream.h
include/haproxy/cs_utils.h
src/backend.c
src/check.c
src/cli.c
src/conn_stream.c
src/connection.c
src/frontend.c
src/hlua.c
src/http_ana.c
src/log.c
src/mux_pt.c
src/ssl_sample.c
src/stream.c
src/tcp_sample.c
src/tcpcheck.c

index cad043aec06642501b398e96eb8a88ec7be41540..30ef61b36ef4110634db7160852940c4ccaeedca 100644 (file)
@@ -33,7 +33,7 @@ struct appctx;
 struct stream;
 struct check;
 
-#define IS_HTX_CS(cs)     (cs_conn(cs) && IS_HTX_CONN(__cs_conn(cs)))
+#define IS_HTX_CS(cs)     (sc_conn(cs) && IS_HTX_CONN(__sc_conn(cs)))
 
 struct sedesc *sedesc_new();
 void sedesc_free(struct sedesc *sedesc);
@@ -131,17 +131,17 @@ static inline void *__cs_endp_target(const struct stconn *cs)
 }
 
 /* Returns the connection from a cs if the endpoint is a mux stream. Otherwise
- * NULL is returned. __cs_conn() returns the connection without any control
- * while cs_conn() check the endpoint type.
+ * NULL is returned. __sc_conn() returns the connection without any control
+ * while sc_conn() check the endpoint type.
  */
-static inline struct connection *__cs_conn(const struct stconn *cs)
+static inline struct connection *__sc_conn(const struct stconn *cs)
 {
        return cs->sedesc->conn;
 }
-static inline struct connection *cs_conn(const struct stconn *cs)
+static inline struct connection *sc_conn(const struct stconn *cs)
 {
        if (sc_ep_test(cs, SE_FL_T_MUX))
-               return __cs_conn(cs);
+               return __sc_conn(cs);
        return NULL;
 }
 
@@ -150,7 +150,7 @@ static inline struct connection *cs_conn(const struct stconn *cs)
  */
 static inline const struct mux_ops *cs_conn_mux(const struct stconn *cs)
 {
-       const struct connection *conn = cs_conn(cs);
+       const struct connection *conn = sc_conn(cs);
 
        return (conn ? conn->mux : NULL);
 }
@@ -227,7 +227,7 @@ static inline void cs_conn_shutr(struct stconn *cs, enum co_shr_mode mode)
 {
        const struct mux_ops *mux;
 
-       BUG_ON(!cs_conn(cs));
+       BUG_ON(!sc_conn(cs));
 
        if (sc_ep_test(cs, SE_FL_SHR))
                return;
@@ -244,7 +244,7 @@ static inline void cs_conn_shutw(struct stconn *cs, enum co_shw_mode mode)
 {
        const struct mux_ops *mux;
 
-       BUG_ON(!cs_conn(cs));
+       BUG_ON(!sc_conn(cs));
 
        if (sc_ep_test(cs, SE_FL_SHW))
                return;
index db6cde61ebe11b159acd1426db1cbd415ff42ff2..b263985f67372e6d07d0dc3e0354bd324f1a86bc 100644 (file)
@@ -122,7 +122,7 @@ static inline int cs_state_in(enum cs_state state, enum cs_state_bit mask)
  */
 static inline int cs_conn_ready(struct stconn *cs)
 {
-       struct connection *conn = cs_conn(cs);
+       struct connection *conn = sc_conn(cs);
 
        return conn && conn_ctrl_ready(conn) && conn_xprt_ready(conn);
 }
@@ -141,7 +141,7 @@ static inline int cs_is_conn_error(const struct stconn *cs)
        if (cs->state >= SC_ST_EST)
                return 0;
 
-       conn = __cs_conn(cs);
+       conn = __sc_conn(cs);
        BUG_ON(!conn);
        return !!(conn->flags & CO_FL_ERROR);
 }
@@ -176,7 +176,7 @@ static inline const struct sockaddr_storage *cs_src(struct stconn *cs)
        if (!(cs->flags & SC_FL_ISBACK))
                return sess_src(strm_sess(__sc_strm(cs)));
        else {
-               struct connection *conn = cs_conn(cs);
+               struct connection *conn = sc_conn(cs);
 
                if (conn)
                        return conn_src(conn);
@@ -196,7 +196,7 @@ static inline const struct sockaddr_storage *cs_dst(struct stconn *cs)
        if (!(cs->flags & SC_FL_ISBACK))
                return sess_dst(strm_sess(__sc_strm(cs)));
        else {
-               struct connection *conn = cs_conn(cs);
+               struct connection *conn = sc_conn(cs);
 
                if (conn)
                        return conn_dst(conn);
@@ -220,7 +220,7 @@ static inline int cs_get_src(struct stconn *cs)
        if (!(cs->flags & SC_FL_ISBACK))
                src = sess_src(strm_sess(__sc_strm(cs)));
        else {
-               struct connection *conn = cs_conn(cs);
+               struct connection *conn = sc_conn(cs);
 
                if (conn)
                        src = conn_src(conn);
@@ -250,7 +250,7 @@ static inline int cs_get_dst(struct stconn *cs)
        if (!(cs->flags & SC_FL_ISBACK))
                dst = sess_dst(strm_sess(__sc_strm(cs)));
        else {
-               struct connection *conn = cs_conn(cs);
+               struct connection *conn = sc_conn(cs);
 
                if (conn)
                        dst = conn_dst(conn);
index 83b3bf1ef5b1947e509c12ae82680220a6b6a8f7..131e5a4038c0b9484f2b32c0d2c15b2eebac0731 100644 (file)
@@ -2301,7 +2301,7 @@ void back_handle_st_cer(struct stream *s)
 
        /* we probably have to release last stream from the server */
        if (objt_server(s->target)) {
-               struct connection *conn = cs_conn(cs);
+               struct connection *conn = sc_conn(cs);
 
                health_adjust(__objt_server(s->target), HANA_STATUS_L4_ERR);
 
index 7aafb79a1e24b8fc143ebf86dcf554aa89c922e9..20ed5b4faf6e70181dc85e388df2504210bb3cec 100644 (file)
@@ -224,7 +224,7 @@ static void check_trace(enum trace_level level, uint64_t mask,
 
 
        if (check->cs) {
-               struct connection *conn = cs_conn(check->cs);
+               struct connection *conn = sc_conn(check->cs);
 
                chunk_appendf(&trace_buf, " - conn=%p(0x%08x)", conn, conn ? conn->flags : 0);
                chunk_appendf(&trace_buf, " cs=%p(0x%08x)", check->cs, check->cs->flags);
@@ -772,7 +772,7 @@ static int retrieve_errno_from_socket(struct connection *conn)
 void chk_report_conn_err(struct check *check, int errno_bck, int expired)
 {
        struct stconn *cs = check->cs;
-       struct connection *conn = cs_conn(cs);
+       struct connection *conn = sc_conn(cs);
        const char *err_msg;
        struct buffer *chk;
        int step;
@@ -1029,7 +1029,7 @@ int wake_srv_chk(struct stconn *cs)
        ret = tcpcheck_main(check);
 
        cs = check->cs;
-       conn = cs_conn(cs);
+       conn = sc_conn(cs);
 
        if (unlikely(!conn || !cs || conn->flags & CO_FL_ERROR || sc_ep_test(cs, SE_FL_ERROR))) {
                /* We may get error reports bypassing the I/O handlers, typically
@@ -1134,7 +1134,7 @@ struct task *process_chk_conn(struct task *t, void *context, unsigned int state)
         */
        if (check->result == CHK_RES_UNKNOWN && likely(!(check->state & CHK_ST_PURGE))) {
                cs = check->cs;
-               conn = (cs ? cs_conn(cs) : NULL);
+               conn = (cs ? sc_conn(cs) : NULL);
 
                /* Here the connection must be defined. Otherwise the
                 * error would have already been detected
@@ -1168,7 +1168,7 @@ struct task *process_chk_conn(struct task *t, void *context, unsigned int state)
 
        check->current_step = NULL;
        cs = check->cs;
-       conn = (cs ? cs_conn(cs) : NULL);
+       conn = (cs ? sc_conn(cs) : NULL);
 
        if (conn && conn->xprt) {
                /* The check was aborted and the connection was not yet closed.
index e388d82f2b4e5f8191292371a8031ff2063103c6..b91b39280e8d3bec163562ee34f16df28731a228 100644 (file)
--- a/src/cli.c
+++ b/src/cli.c
@@ -1971,7 +1971,7 @@ static int _getsocks(char **args, char *payload, struct appctx *appctx, void *pr
        struct cmsghdr *cmsg;
        struct stconn *cs = appctx_cs(appctx);
        struct stream *s = __sc_strm(cs);
-       struct connection *remote = cs_conn(cs_opposite(cs));
+       struct connection *remote = sc_conn(cs_opposite(cs));
        struct msghdr msghdr;
        struct iovec iov;
        struct timeval tv = { .tv_sec = 1, .tv_usec = 0 };
index 98137b884376fc3229925c43b3b541d22472d8ca..06b147343c04b391c79770121a376760b79f0c34 100644 (file)
@@ -345,7 +345,7 @@ static void cs_detach_endp(struct stconn **csp)
                goto reset_cs;
 
        if (sc_ep_test(cs, SE_FL_T_MUX)) {
-               struct connection *conn = __cs_conn(cs);
+               struct connection *conn = __sc_conn(cs);
                struct sedesc *sedesc = cs->sedesc;
 
                if (conn->mux) {
@@ -649,7 +649,7 @@ static void sc_app_shutr_conn(struct stconn *cs)
 {
        struct channel *ic = sc_ic(cs);
 
-       BUG_ON(!cs_conn(cs));
+       BUG_ON(!sc_conn(cs));
 
        cs_rx_shut_blk(cs);
        if (ic->flags & CF_SHUTR)
@@ -684,7 +684,7 @@ static void sc_app_shutw_conn(struct stconn *cs)
        struct channel *ic = sc_ic(cs);
        struct channel *oc = sc_oc(cs);
 
-       BUG_ON(!cs_conn(cs));
+       BUG_ON(!sc_conn(cs));
 
        oc->flags &= ~CF_SHUTW_NOW;
        if (oc->flags & CF_SHUTW)
@@ -761,7 +761,7 @@ static void sc_app_shutw_conn(struct stconn *cs)
  */
 static void sc_app_chk_rcv_conn(struct stconn *cs)
 {
-       BUG_ON(!cs_conn(cs));
+       BUG_ON(!sc_conn(cs));
 
        /* (re)start reading */
        if (cs_state_in(cs->state, SC_SB_CON|SC_SB_RDY|SC_SB_EST))
@@ -778,7 +778,7 @@ static void sc_app_chk_snd_conn(struct stconn *cs)
 {
        struct channel *oc = sc_oc(cs);
 
-       BUG_ON(!cs_conn(cs));
+       BUG_ON(!sc_conn(cs));
 
        if (unlikely(!cs_state_in(cs->state, SC_SB_RDY|SC_SB_EST) ||
            (oc->flags & CF_SHUTW)))
@@ -1117,7 +1117,7 @@ static void cs_notify(struct stconn *cs)
 
        /* process consumer side */
        if (channel_is_empty(oc)) {
-               struct connection *conn = cs_conn(cs);
+               struct connection *conn = sc_conn(cs);
 
                if (((oc->flags & (CF_SHUTW|CF_SHUTW_NOW)) == CF_SHUTW_NOW) &&
                    (cs->state == SC_ST_EST) && (!conn || !(conn->flags & (CO_FL_WAIT_XPRT | CO_FL_EARLY_SSL_HS))))
@@ -1242,7 +1242,7 @@ static void cs_conn_read0(struct stconn *cs)
        struct channel *ic = sc_ic(cs);
        struct channel *oc = sc_oc(cs);
 
-       BUG_ON(!cs_conn(cs));
+       BUG_ON(!sc_conn(cs));
 
        cs_rx_shut_blk(cs);
        if (ic->flags & CF_SHUTR)
@@ -1288,7 +1288,7 @@ static void cs_conn_read0(struct stconn *cs)
  */
 static int cs_conn_recv(struct stconn *cs)
 {
-       struct connection *conn = __cs_conn(cs);
+       struct connection *conn = __sc_conn(cs);
        struct channel *ic = sc_ic(cs);
        int ret, max, cur_read = 0;
        int read_poll = MAX_READ_POLL_LOOPS;
@@ -1642,7 +1642,7 @@ int cs_conn_sync_recv(struct stconn *cs)
  */
 static int cs_conn_send(struct stconn *cs)
 {
-       struct connection *conn = __cs_conn(cs);
+       struct connection *conn = __sc_conn(cs);
        struct stream *s = __sc_strm(cs);
        struct channel *oc = sc_oc(cs);
        int ret;
@@ -1814,7 +1814,7 @@ void cs_conn_sync_send(struct stconn *cs)
  */
 static int cs_conn_process(struct stconn *cs)
 {
-       struct connection *conn = __cs_conn(cs);
+       struct connection *conn = __sc_conn(cs);
        struct channel *ic = sc_ic(cs);
        struct channel *oc = sc_oc(cs);
 
@@ -1905,7 +1905,7 @@ struct task *cs_conn_io_cb(struct task *t, void *ctx, unsigned int state)
        struct stconn *cs = ctx;
        int ret = 0;
 
-       if (!cs_conn(cs))
+       if (!sc_conn(cs))
                return t;
 
        if (!(cs->wait_event.events & SUB_RETRY_SEND) && !channel_is_empty(sc_oc(cs)))
index 53ac9a66535408ef3ce2bffc5b2a721efea2f6aa..f3775e85f6d8558f703fb9a5c8c922a72beea77d 100644 (file)
@@ -1191,7 +1191,7 @@ int conn_send_proxy(struct connection *conn, unsigned int flag)
                if (cs && sc_strm(cs)) {
                        ret = make_proxy_line(trash.area, trash.size,
                                              objt_server(conn->target),
-                                             cs_conn(cs_opposite(cs)),
+                                             sc_conn(cs_opposite(cs)),
                                              __sc_strm(cs));
                }
                else {
@@ -2103,10 +2103,10 @@ smp_fetch_fc_http_major(const struct arg *args, struct sample *smp, const char *
        struct connection *conn = NULL;
 
        if (obj_type(smp->sess->origin) == OBJ_TYPE_CHECK)
-                conn = (kw[0] == 'b') ? cs_conn(__objt_check(smp->sess->origin)->cs) : NULL;
+                conn = (kw[0] == 'b') ? sc_conn(__objt_check(smp->sess->origin)->cs) : NULL;
         else
                 conn = (kw[0] != 'b') ? objt_conn(smp->sess->origin) :
-                       smp->strm ? cs_conn(smp->strm->scb) : NULL;
+                       smp->strm ? sc_conn(smp->strm->scb) : NULL;
 
        /* No connection or a connection with a RAW muxx */
        if (!conn || (conn->mux && !(conn->mux->flags & MX_FL_HTX)))
@@ -2200,10 +2200,10 @@ int smp_fetch_fc_err(const struct arg *args, struct sample *smp, const char *kw,
        struct connection *conn;
 
        if (obj_type(smp->sess->origin) == OBJ_TYPE_CHECK)
-                conn = (kw[0] == 'b') ? cs_conn(__objt_check(smp->sess->origin)->cs) : NULL;
+                conn = (kw[0] == 'b') ? sc_conn(__objt_check(smp->sess->origin)->cs) : NULL;
         else
                 conn = (kw[0] != 'b') ? objt_conn(smp->sess->origin) :
-                       smp->strm ? cs_conn(smp->strm->scb) : NULL;
+                       smp->strm ? sc_conn(smp->strm->scb) : NULL;
 
        if (!conn)
                return 0;
@@ -2227,10 +2227,10 @@ int smp_fetch_fc_err_str(const struct arg *args, struct sample *smp, const char
        const char *err_code_str;
 
        if (obj_type(smp->sess->origin) == OBJ_TYPE_CHECK)
-                conn = (kw[0] == 'b') ? cs_conn(__objt_check(smp->sess->origin)->cs) : NULL;
+                conn = (kw[0] == 'b') ? sc_conn(__objt_check(smp->sess->origin)->cs) : NULL;
         else
                 conn = (kw[0] != 'b') ? objt_conn(smp->sess->origin) :
-                       smp->strm ? cs_conn(smp->strm->scb) : NULL;
+                       smp->strm ? sc_conn(smp->strm->scb) : NULL;
 
        if (!conn)
                return 0;
index d2e949d411a6db256264311aae9e2a8a2d8f183e..48c654b7488839a981f0949646737fbb4a982926 100644 (file)
@@ -105,7 +105,7 @@ int frontend_accept(struct stream *s)
                int alpn_len;
 
                /* try to report the ALPN value when available (also works for NPN) */
-               if (conn == cs_conn(s->scf)) {
+               if (conn == sc_conn(s->scf)) {
                        if (conn_get_alpn(conn, &alpn_str, &alpn_len) && alpn_str) {
                                int len = MIN(alpn_len, sizeof(alpn) - 1);
                                memcpy(alpn, alpn_str, len);
index 64b0527f380a3728095dd9e1b0b5d2b0cfd77fb3..1fdfcf3d1b69ea06d65ddf7de32c578c06e2f23b 100644 (file)
@@ -2678,7 +2678,7 @@ static int hlua_socket_getsockname(struct lua_State *L)
        appctx = container_of(peer, struct hlua_csk_ctx, xref)->appctx;
        s = appctx_strm(appctx);
 
-       conn = cs_conn(s->scb);
+       conn = sc_conn(s->scb);
        if (!conn || !conn_get_src(conn)) {
                xref_unlock(&socket->xref, peer);
                lua_pushnil(L);
index 308b7d6660fa7ccba3f774e25f87397c88f6ec1d..55c0a34174fdd0765649448239a66ed76d4f43c5 100644 (file)
@@ -1335,7 +1335,7 @@ int http_wait_for_response(struct stream *s, struct channel *rep, int an_bit)
        if (unlikely(htx_is_empty(htx) || htx->first == -1)) {
                /* 1: have we encountered a read error ? */
                if (rep->flags & CF_READ_ERROR) {
-                       struct connection *conn = cs_conn(s->scb);
+                       struct connection *conn = sc_conn(s->scb);
 
                        /* Perform a L7 retry because server refuses the early data. */
                        if ((txn->flags & TX_L7_RETRY) &&
@@ -1666,7 +1666,7 @@ int http_wait_for_response(struct stream *s, struct channel *rep, int an_bit)
        /* check for NTML authentication headers in 401 (WWW-Authenticate) and
         * 407 (Proxy-Authenticate) responses and set the connection to private
         */
-       srv_conn = cs_conn(s->scb);
+       srv_conn = sc_conn(s->scb);
        if (srv_conn) {
                struct ist hdr;
                struct http_hdr_ctx ctx;
@@ -5098,7 +5098,7 @@ static void http_debug_stline(const char *dir, struct stream *s, const struct ht
         chunk_printf(&trash, "%08x:%s.%s[%04x:%04x]: ", s->uniq_id, s->be->id,
                      dir,
                      objt_conn(sess->origin) ? (unsigned short)__objt_conn(sess->origin)->handle.fd : -1,
-                     cs_conn(s->scb) ? (unsigned short)(__cs_conn(s->scb))->handle.fd : -1);
+                     sc_conn(s->scb) ? (unsigned short)(__sc_conn(s->scb))->handle.fd : -1);
 
         max = HTX_SL_P1_LEN(sl);
         UBOUND(max, trash.size - trash.data - 3);
@@ -5129,7 +5129,7 @@ static void http_debug_hdr(const char *dir, struct stream *s, const struct ist n
         chunk_printf(&trash, "%08x:%s.%s[%04x:%04x]: ", s->uniq_id, s->be->id,
                      dir,
                      objt_conn(sess->origin) ? (unsigned short)__objt_conn(sess->origin)->handle.fd : -1,
-                     cs_conn(s->scb) ? (unsigned short)(__cs_conn(s->scb))->handle.fd : -1);
+                     sc_conn(s->scb) ? (unsigned short)(__sc_conn(s->scb))->handle.fd : -1);
 
         max = n.len;
         UBOUND(max, trash.size - trash.data - 3);
index 6eade9aeeb558a5c9bb376285d954392e9e922e1..a868a7ec41f264e0a67b7b2323bc0bd68cec1e6a 100644 (file)
--- a/src/log.c
+++ b/src/log.c
@@ -1982,7 +1982,7 @@ int sess_build_logline(struct session *sess, struct stream *s, char *dst, size_t
        if (likely(s)) {
                be = s->be;
                txn = s->txn;
-               be_conn = cs_conn(s->scb);
+               be_conn = sc_conn(s->scb);
                status = (txn ? txn->status : 0);
                s_flags = s->flags;
                uniq_id = s->uniq_id;
@@ -1998,7 +1998,7 @@ int sess_build_logline(struct session *sess, struct stream *s, char *dst, size_t
                be = ((obj_type(sess->origin) == OBJ_TYPE_CHECK) ? __objt_check(sess->origin)->proxy : fe);
                txn = NULL;
                fe_conn = objt_conn(sess->origin);
-               be_conn = ((obj_type(sess->origin) == OBJ_TYPE_CHECK) ? cs_conn(__objt_check(sess->origin)->cs) : NULL);
+               be_conn = ((obj_type(sess->origin) == OBJ_TYPE_CHECK) ? sc_conn(__objt_check(sess->origin)->cs) : NULL);
                status = 0;
                s_flags = SF_ERR_PRXCOND | SF_FINST_R;
                uniq_id = _HA_ATOMIC_FETCH_ADD(&global.req_count, 1);
index cbfc789533a8f21635eada56d99967bfe1148bf8..b8a375e13dda1819ce6ddcbabb03bc839c140b93 100644 (file)
@@ -461,7 +461,7 @@ static int mux_pt_avail_streams(struct connection *conn)
 
 static void mux_pt_shutr(struct stconn *cs, enum co_shr_mode mode)
 {
-       struct connection *conn = __cs_conn(cs);
+       struct connection *conn = __sc_conn(cs);
        struct mux_pt_ctx *ctx = conn->ctx;
 
        TRACE_ENTER(PT_EV_STRM_SHUT, conn, cs);
@@ -482,7 +482,7 @@ static void mux_pt_shutr(struct stconn *cs, enum co_shr_mode mode)
 
 static void mux_pt_shutw(struct stconn *cs, enum co_shw_mode mode)
 {
-       struct connection *conn = __cs_conn(cs);
+       struct connection *conn = __sc_conn(cs);
        struct mux_pt_ctx *ctx = conn->ctx;
 
        TRACE_ENTER(PT_EV_STRM_SHUT, conn, cs);
@@ -515,7 +515,7 @@ static void mux_pt_shutw(struct stconn *cs, enum co_shw_mode mode)
  */
 static size_t mux_pt_rcv_buf(struct stconn *cs, struct buffer *buf, size_t count, int flags)
 {
-       struct connection *conn = __cs_conn(cs);
+       struct connection *conn = __sc_conn(cs);
        struct mux_pt_ctx *ctx = conn->ctx;
        size_t ret = 0;
 
@@ -545,7 +545,7 @@ static size_t mux_pt_rcv_buf(struct stconn *cs, struct buffer *buf, size_t count
 /* Called from the upper layer, to send data */
 static size_t mux_pt_snd_buf(struct stconn *cs, struct buffer *buf, size_t count, int flags)
 {
-       struct connection *conn = __cs_conn(cs);
+       struct connection *conn = __sc_conn(cs);
        struct mux_pt_ctx *ctx = conn->ctx;
        size_t ret;
 
@@ -572,7 +572,7 @@ static size_t mux_pt_snd_buf(struct stconn *cs, struct buffer *buf, size_t count
  */
 static int mux_pt_subscribe(struct stconn *cs, int event_type, struct wait_event *es)
 {
-       struct connection *conn = __cs_conn(cs);
+       struct connection *conn = __sc_conn(cs);
 
        TRACE_POINT(PT_EV_RX_DATA|PT_EV_TX_DATA, conn, cs, 0, (size_t[]){event_type});
        return conn->xprt->subscribe(conn, conn->xprt_ctx, event_type, es);
@@ -584,7 +584,7 @@ static int mux_pt_subscribe(struct stconn *cs, int event_type, struct wait_event
  */
 static int mux_pt_unsubscribe(struct stconn *cs, int event_type, struct wait_event *es)
 {
-       struct connection *conn = __cs_conn(cs);
+       struct connection *conn = __sc_conn(cs);
 
        TRACE_POINT(PT_EV_RX_DATA|PT_EV_TX_DATA, conn, cs, 0, (size_t[]){event_type});
        return conn->xprt->unsubscribe(conn, conn->xprt_ctx, event_type, es);
@@ -594,7 +594,7 @@ static int mux_pt_unsubscribe(struct stconn *cs, int event_type, struct wait_eve
 /* Send and get, using splicing */
 static int mux_pt_rcv_pipe(struct stconn *cs, struct pipe *pipe, unsigned int count)
 {
-       struct connection *conn = __cs_conn(cs);
+       struct connection *conn = __sc_conn(cs);
        struct mux_pt_ctx *ctx = conn->ctx;
        int ret;
 
@@ -616,7 +616,7 @@ static int mux_pt_rcv_pipe(struct stconn *cs, struct pipe *pipe, unsigned int co
 
 static int mux_pt_snd_pipe(struct stconn *cs, struct pipe *pipe)
 {
-       struct connection *conn = __cs_conn(cs);
+       struct connection *conn = __sc_conn(cs);
        struct mux_pt_ctx *ctx = conn->ctx;
        int ret;
 
index ea5677c650226ac4cfa68ba7145e8028c8dd58ea..9031dc49865c7f877b7a42d293cd1be33b9e0649 100644 (file)
@@ -526,7 +526,7 @@ smp_fetch_ssl_x_der(const struct arg *args, struct sample *smp, const char *kw,
        SSL *ssl;
 
        if (conn_server)
-               conn = smp->strm ? cs_conn(smp->strm->scb) : NULL;
+               conn = smp->strm ? sc_conn(smp->strm->scb) : NULL;
        else
                conn = objt_conn(smp->sess->origin);
 
@@ -581,7 +581,7 @@ smp_fetch_ssl_x_chain_der(const struct arg *args, struct sample *smp, const char
        int i;
 
        if (conn_server)
-               conn = smp->strm ? cs_conn(smp->strm->scb) : NULL;
+               conn = smp->strm ? sc_conn(smp->strm->scb) : NULL;
        else
                conn = objt_conn(smp->sess->origin);
 
@@ -644,7 +644,7 @@ smp_fetch_ssl_x_serial(const struct arg *args, struct sample *smp, const char *k
        SSL *ssl;
 
        if (conn_server)
-               conn = smp->strm ? cs_conn(smp->strm->scb) : NULL;
+               conn = smp->strm ? sc_conn(smp->strm->scb) : NULL;
        else
                conn = objt_conn(smp->sess->origin);
        ssl = ssl_sock_get_ssl_object(conn);
@@ -697,7 +697,7 @@ smp_fetch_ssl_x_sha1(const struct arg *args, struct sample *smp, const char *kw,
        SSL *ssl;
 
        if (conn_server)
-               conn = smp->strm ? cs_conn(smp->strm->scb) : NULL;
+               conn = smp->strm ? sc_conn(smp->strm->scb) : NULL;
        else
                conn = objt_conn(smp->sess->origin);
 
@@ -748,7 +748,7 @@ smp_fetch_ssl_x_notafter(const struct arg *args, struct sample *smp, const char
        SSL *ssl;
 
        if (conn_server)
-               conn = smp->strm ? cs_conn(smp->strm->scb) : NULL;
+               conn = smp->strm ? sc_conn(smp->strm->scb) : NULL;
        else
                conn = objt_conn(smp->sess->origin);
 
@@ -800,7 +800,7 @@ smp_fetch_ssl_x_i_dn(const struct arg *args, struct sample *smp, const char *kw,
        SSL *ssl;
 
        if (conn_server)
-               conn = smp->strm ? cs_conn(smp->strm->scb) : NULL;
+               conn = smp->strm ? sc_conn(smp->strm->scb) : NULL;
        else
                conn = objt_conn(smp->sess->origin);
 
@@ -868,7 +868,7 @@ smp_fetch_ssl_x_notbefore(const struct arg *args, struct sample *smp, const char
        SSL *ssl;
 
        if (conn_server)
-               conn = smp->strm ? cs_conn(smp->strm->scb) : NULL;
+               conn = smp->strm ? sc_conn(smp->strm->scb) : NULL;
        else
                conn = objt_conn(smp->sess->origin);
 
@@ -920,7 +920,7 @@ smp_fetch_ssl_x_s_dn(const struct arg *args, struct sample *smp, const char *kw,
        SSL *ssl;
 
        if (conn_server)
-               conn = smp->strm ? cs_conn(smp->strm->scb) : NULL;
+               conn = smp->strm ? sc_conn(smp->strm->scb) : NULL;
        else
                conn = objt_conn(smp->sess->origin);
 
@@ -1017,7 +1017,7 @@ smp_fetch_ssl_x_version(const struct arg *args, struct sample *smp, const char *
        SSL *ssl;
 
        if (conn_server)
-               conn = smp->strm ? cs_conn(smp->strm->scb) : NULL;
+               conn = smp->strm ? sc_conn(smp->strm->scb) : NULL;
        else
                conn = objt_conn(smp->sess->origin);
        ssl = ssl_sock_get_ssl_object(conn);
@@ -1062,7 +1062,7 @@ smp_fetch_ssl_x_sig_alg(const struct arg *args, struct sample *smp, const char *
        SSL *ssl;
 
        if (conn_server)
-               conn = smp->strm ? cs_conn(smp->strm->scb) : NULL;
+               conn = smp->strm ? sc_conn(smp->strm->scb) : NULL;
        else
                conn = objt_conn(smp->sess->origin);
 
@@ -1119,7 +1119,7 @@ smp_fetch_ssl_x_key_alg(const struct arg *args, struct sample *smp, const char *
        SSL *ssl;
 
        if (conn_server)
-               conn = smp->strm ? cs_conn(smp->strm->scb) : NULL;
+               conn = smp->strm ? sc_conn(smp->strm->scb) : NULL;
        else
                conn = objt_conn(smp->sess->origin);
        ssl = ssl_sock_get_ssl_object(conn);
@@ -1168,10 +1168,10 @@ smp_fetch_ssl_fc(const struct arg *args, struct sample *smp, const char *kw, voi
        struct connection *conn;
 
        if (obj_type(smp->sess->origin) == OBJ_TYPE_CHECK)
-               conn = (kw[4] == 'b') ? cs_conn(__objt_check(smp->sess->origin)->cs) : NULL;
+               conn = (kw[4] == 'b') ? sc_conn(__objt_check(smp->sess->origin)->cs) : NULL;
        else
                conn = (kw[4] != 'b') ? objt_conn(smp->sess->origin) :
-                       smp->strm ? cs_conn(smp->strm->scb) : NULL;
+                       smp->strm ? sc_conn(smp->strm->scb) : NULL;
 
        smp->data.type = SMP_T_BOOL;
        smp->data.u.sint = conn_is_ssl(conn);
@@ -1205,10 +1205,10 @@ smp_fetch_ssl_fc_is_resumed(const struct arg *args, struct sample *smp, const ch
        SSL *ssl;
 
        if (obj_type(smp->sess->origin) == OBJ_TYPE_CHECK)
-               conn = (kw[4] == 'b') ? cs_conn(__objt_check(smp->sess->origin)->cs) : NULL;
+               conn = (kw[4] == 'b') ? sc_conn(__objt_check(smp->sess->origin)->cs) : NULL;
        else
                conn = (kw[4] != 'b') ? objt_conn(smp->sess->origin) :
-                       smp->strm ? cs_conn(smp->strm->scb) : NULL;
+                       smp->strm ? sc_conn(smp->strm->scb) : NULL;
 
        ssl = ssl_sock_get_ssl_object(conn);
 
@@ -1228,10 +1228,10 @@ smp_fetch_ssl_fc_cipher(const struct arg *args, struct sample *smp, const char *
        SSL *ssl;
 
        if (obj_type(smp->sess->origin) == OBJ_TYPE_CHECK)
-               conn = (kw[4] == 'b') ? cs_conn(__objt_check(smp->sess->origin)->cs) : NULL;
+               conn = (kw[4] == 'b') ? sc_conn(__objt_check(smp->sess->origin)->cs) : NULL;
        else
                conn = (kw[4] != 'b') ? objt_conn(smp->sess->origin) :
-                       smp->strm ? cs_conn(smp->strm->scb) : NULL;
+                       smp->strm ? sc_conn(smp->strm->scb) : NULL;
 
        smp->flags = 0;
        ssl = ssl_sock_get_ssl_object(conn);
@@ -1262,10 +1262,10 @@ smp_fetch_ssl_fc_alg_keysize(const struct arg *args, struct sample *smp, const c
        int sint;
 
        if (obj_type(smp->sess->origin) == OBJ_TYPE_CHECK)
-               conn = (kw[4] == 'b') ? cs_conn(__objt_check(smp->sess->origin)->cs) : NULL;
+               conn = (kw[4] == 'b') ? sc_conn(__objt_check(smp->sess->origin)->cs) : NULL;
        else
                conn = (kw[4] != 'b') ? objt_conn(smp->sess->origin) :
-                       smp->strm ? cs_conn(smp->strm->scb) : NULL;
+                       smp->strm ? sc_conn(smp->strm->scb) : NULL;
 
        smp->flags = 0;
        ssl = ssl_sock_get_ssl_object(conn);
@@ -1293,10 +1293,10 @@ smp_fetch_ssl_fc_use_keysize(const struct arg *args, struct sample *smp, const c
        SSL *ssl;
 
        if (obj_type(smp->sess->origin) == OBJ_TYPE_CHECK)
-               conn = (kw[4] == 'b') ? cs_conn(__objt_check(smp->sess->origin)->cs) : NULL;
+               conn = (kw[4] == 'b') ? sc_conn(__objt_check(smp->sess->origin)->cs) : NULL;
        else
                conn = (kw[4] != 'b') ? objt_conn(smp->sess->origin) :
-                       smp->strm ? cs_conn(smp->strm->scb) : NULL;
+                       smp->strm ? sc_conn(smp->strm->scb) : NULL;
 
        smp->flags = 0;
        ssl = ssl_sock_get_ssl_object(conn);
@@ -1325,10 +1325,10 @@ smp_fetch_ssl_fc_npn(const struct arg *args, struct sample *smp, const char *kw,
        smp->data.type = SMP_T_STR;
 
        if (obj_type(smp->sess->origin) == OBJ_TYPE_CHECK)
-               conn = (kw[4] == 'b') ? cs_conn(__objt_check(smp->sess->origin)->cs) : NULL;
+               conn = (kw[4] == 'b') ? sc_conn(__objt_check(smp->sess->origin)->cs) : NULL;
        else
                conn = (kw[4] != 'b') ? objt_conn(smp->sess->origin) :
-                       smp->strm ? cs_conn(smp->strm->scb) : NULL;
+                       smp->strm ? sc_conn(smp->strm->scb) : NULL;
 
        ssl = ssl_sock_get_ssl_object(conn);
        if (!ssl)
@@ -1360,10 +1360,10 @@ smp_fetch_ssl_fc_alpn(const struct arg *args, struct sample *smp, const char *kw
        smp->data.type = SMP_T_STR;
 
        if (obj_type(smp->sess->origin) == OBJ_TYPE_CHECK)
-               conn = (kw[4] == 'b') ? cs_conn(__objt_check(smp->sess->origin)->cs) : NULL;
+               conn = (kw[4] == 'b') ? sc_conn(__objt_check(smp->sess->origin)->cs) : NULL;
        else
                conn = (kw[4] != 'b') ? objt_conn(smp->sess->origin) :
-                       smp->strm ? cs_conn(smp->strm->scb) : NULL;
+                       smp->strm ? sc_conn(smp->strm->scb) : NULL;
 
        ssl = ssl_sock_get_ssl_object(conn);
        if (!ssl)
@@ -1393,10 +1393,10 @@ smp_fetch_ssl_fc_protocol(const struct arg *args, struct sample *smp, const char
        SSL *ssl;
 
        if (obj_type(smp->sess->origin) == OBJ_TYPE_CHECK)
-               conn = (kw[4] == 'b') ? cs_conn(__objt_check(smp->sess->origin)->cs) : NULL;
+               conn = (kw[4] == 'b') ? sc_conn(__objt_check(smp->sess->origin)->cs) : NULL;
        else
                conn = (kw[4] != 'b') ? objt_conn(smp->sess->origin) :
-                       smp->strm ? cs_conn(smp->strm->scb) : NULL;
+                       smp->strm ? sc_conn(smp->strm->scb) : NULL;
 
        smp->flags = 0;
        ssl = ssl_sock_get_ssl_object(conn);
@@ -1431,10 +1431,10 @@ smp_fetch_ssl_fc_session_id(const struct arg *args, struct sample *smp, const ch
        smp->data.type = SMP_T_BIN;
 
        if (obj_type(smp->sess->origin) == OBJ_TYPE_CHECK)
-               conn = (kw[4] == 'b') ? cs_conn(__objt_check(smp->sess->origin)->cs) : NULL;
+               conn = (kw[4] == 'b') ? sc_conn(__objt_check(smp->sess->origin)->cs) : NULL;
        else
                conn = (kw[4] != 'b') ? objt_conn(smp->sess->origin) :
-                       smp->strm ? cs_conn(smp->strm->scb) : NULL;
+                       smp->strm ? sc_conn(smp->strm->scb) : NULL;
 
        ssl = ssl_sock_get_ssl_object(conn);
        if (!ssl)
@@ -1463,10 +1463,10 @@ smp_fetch_ssl_fc_random(const struct arg *args, struct sample *smp, const char *
        SSL *ssl;
 
        if (obj_type(smp->sess->origin) == OBJ_TYPE_CHECK)
-               conn = (kw[4] == 'b') ? cs_conn(__objt_check(smp->sess->origin)->cs) : NULL;
+               conn = (kw[4] == 'b') ? sc_conn(__objt_check(smp->sess->origin)->cs) : NULL;
        else
                conn = (kw[4] != 'b') ? objt_conn(smp->sess->origin) :
-                       smp->strm ? cs_conn(smp->strm->scb) : NULL;
+                       smp->strm ? sc_conn(smp->strm->scb) : NULL;
 
        ssl = ssl_sock_get_ssl_object(conn);
        if (!ssl)
@@ -1500,10 +1500,10 @@ smp_fetch_ssl_fc_session_key(const struct arg *args, struct sample *smp, const c
        SSL *ssl;
 
        if (obj_type(smp->sess->origin) == OBJ_TYPE_CHECK)
-               conn = (kw[4] == 'b') ? cs_conn(__objt_check(smp->sess->origin)->cs) : NULL;
+               conn = (kw[4] == 'b') ? sc_conn(__objt_check(smp->sess->origin)->cs) : NULL;
        else
                conn = (kw[4] != 'b') ? objt_conn(smp->sess->origin) :
-                       smp->strm ? cs_conn(smp->strm->scb) : NULL;
+                       smp->strm ? sc_conn(smp->strm->scb) : NULL;
 
        ssl = ssl_sock_get_ssl_object(conn);
        if (!ssl)
@@ -1649,10 +1649,10 @@ smp_fetch_ssl_fc_err(const struct arg *args, struct sample *smp, const char *kw,
        struct ssl_sock_ctx *ctx;
 
        if (obj_type(smp->sess->origin) == OBJ_TYPE_CHECK)
-               conn = (kw[4] == 'b') ? cs_conn(__objt_check(smp->sess->origin)->cs) : NULL;
+               conn = (kw[4] == 'b') ? sc_conn(__objt_check(smp->sess->origin)->cs) : NULL;
        else
                conn = (kw[4] != 'b') ? objt_conn(smp->sess->origin) :
-                       smp->strm ? cs_conn(smp->strm->scb) : NULL;
+                       smp->strm ? sc_conn(smp->strm->scb) : NULL;
 
        if (!conn)
                return 0;
@@ -1702,10 +1702,10 @@ smp_fetch_ssl_fc_err_str(const struct arg *args, struct sample *smp, const char
        const char *err_code_str;
 
        if (obj_type(smp->sess->origin) == OBJ_TYPE_CHECK)
-               conn = (kw[4] == 'b') ? cs_conn(__objt_check(smp->sess->origin)->cs) : NULL;
+               conn = (kw[4] == 'b') ? sc_conn(__objt_check(smp->sess->origin)->cs) : NULL;
        else
                conn = (kw[4] != 'b') ? objt_conn(smp->sess->origin) :
-                       smp->strm ? cs_conn(smp->strm->scb) : NULL;
+                       smp->strm ? sc_conn(smp->strm->scb) : NULL;
 
        if (!conn)
                return 0;
@@ -1838,7 +1838,7 @@ static int smp_fetch_ssl_x_keylog(const struct arg *args, struct sample *smp, co
        const char *sfx;
 
        conn = (kw[4] != 'b') ? objt_conn(smp->sess->origin) :
-              smp->strm ? cs_conn(smp->strm->scb) : NULL;
+              smp->strm ? sc_conn(smp->strm->scb) : NULL;
 
        if (!conn)
                return 0;
@@ -1932,10 +1932,10 @@ smp_fetch_ssl_fc_unique_id(const struct arg *args, struct sample *smp, const cha
        SSL *ssl;
 
        if (obj_type(smp->sess->origin) == OBJ_TYPE_CHECK)
-               conn = (kw[4] == 'b') ? cs_conn(__objt_check(smp->sess->origin)->cs) : NULL;
+               conn = (kw[4] == 'b') ? sc_conn(__objt_check(smp->sess->origin)->cs) : NULL;
        else
                conn = (kw[4] != 'b') ? objt_conn(smp->sess->origin) :
-                       smp->strm ? cs_conn(smp->strm->scb) : NULL;
+                       smp->strm ? sc_conn(smp->strm->scb) : NULL;
 
        smp->flags = 0;
        ssl = ssl_sock_get_ssl_object(conn);
index 1c7c0d660a6019ac888a78e1a2e5216d71e42b99..51e18d3118daaa15ca7de888634bbfbdf7b777f2 100644 (file)
@@ -465,7 +465,7 @@ struct stream *stream_new(struct session *sess, struct stconn *cs, struct buffer
 
        if (sc_ep_test(cs, SE_FL_WEBSOCKET))
                s->flags |= SF_WEBSOCKET;
-       if (cs_conn(cs)) {
+       if (sc_conn(cs)) {
                const struct mux_ops *mux = cs_conn_mux(cs);
 
                if (mux && mux->flags & MX_FL_HTX)
@@ -873,7 +873,7 @@ int stream_set_timeout(struct stream *s, enum act_timeout_name name, int timeout
  */
 static void back_establish(struct stream *s)
 {
-       struct connection *conn = cs_conn(s->scb);
+       struct connection *conn = sc_conn(s->scb);
        struct channel *req = &s->req;
        struct channel *rep = &s->res;
 
@@ -1474,7 +1474,7 @@ int stream_set_http_mode(struct stream *s, const struct mux_proto_list *mux_prot
        if (unlikely(!s->txn && !http_create_txn(s)))
                return 0;
 
-       conn = cs_conn(cs);
+       conn = sc_conn(cs);
        if (conn) {
                cs_rx_endp_more(s->scf);
                /* Make sure we're unsubscribed, the the new
@@ -1838,8 +1838,8 @@ struct task *process_stream(struct task *t, void *context, unsigned int state)
                              (global.mode & MODE_VERBOSE)))) {
                        chunk_printf(&trash, "%08x:%s.clicls[%04x:%04x]\n",
                                     s->uniq_id, s->be->id,
-                                    (unsigned short)conn_fd(cs_conn(scf)),
-                                    (unsigned short)conn_fd(cs_conn(scb)));
+                                    (unsigned short)conn_fd(sc_conn(scf)),
+                                    (unsigned short)conn_fd(sc_conn(scb)));
                        DISGUISE(write(1, trash.area, trash.data));
                }
        }
@@ -1869,8 +1869,8 @@ struct task *process_stream(struct task *t, void *context, unsigned int state)
                        if (s->prev_conn_state == SC_ST_EST) {
                                chunk_printf(&trash, "%08x:%s.srvcls[%04x:%04x]\n",
                                             s->uniq_id, s->be->id,
-                                            (unsigned short)conn_fd(cs_conn(scf)),
-                                            (unsigned short)conn_fd(cs_conn(scb)));
+                                            (unsigned short)conn_fd(sc_conn(scf)),
+                                            (unsigned short)conn_fd(sc_conn(scb)));
                                DISGUISE(write(1, trash.area, trash.data));
                        }
                }
@@ -2207,10 +2207,10 @@ struct task *process_stream(struct task *t, void *context, unsigned int state)
        if (!(req->flags & (CF_KERN_SPLICING|CF_SHUTR)) &&
            req->to_forward &&
            (global.tune.options & GTUNE_USE_SPLICE) &&
-           (cs_conn(scf) && __cs_conn(scf)->xprt && __cs_conn(scf)->xprt->rcv_pipe &&
-            __cs_conn(scf)->mux && __cs_conn(scf)->mux->rcv_pipe) &&
-           (cs_conn(scb) && __cs_conn(scb)->xprt && __cs_conn(scb)->xprt->snd_pipe &&
-            __cs_conn(scb)->mux && __cs_conn(scb)->mux->snd_pipe) &&
+           (sc_conn(scf) && __sc_conn(scf)->xprt && __sc_conn(scf)->xprt->rcv_pipe &&
+            __sc_conn(scf)->mux && __sc_conn(scf)->mux->rcv_pipe) &&
+           (sc_conn(scb) && __sc_conn(scb)->xprt && __sc_conn(scb)->xprt->snd_pipe &&
+            __sc_conn(scb)->mux && __sc_conn(scb)->mux->snd_pipe) &&
            (pipes_used < global.maxpipes) &&
            (((sess->fe->options2|s->be->options2) & PR_O2_SPLIC_REQ) ||
             (((sess->fe->options2|s->be->options2) & PR_O2_SPLIC_AUT) &&
@@ -2401,10 +2401,10 @@ struct task *process_stream(struct task *t, void *context, unsigned int state)
        if (!(res->flags & (CF_KERN_SPLICING|CF_SHUTR)) &&
            res->to_forward &&
            (global.tune.options & GTUNE_USE_SPLICE) &&
-           (cs_conn(scf) && __cs_conn(scf)->xprt && __cs_conn(scf)->xprt->snd_pipe &&
-            __cs_conn(scf)->mux && __cs_conn(scf)->mux->snd_pipe) &&
-           (cs_conn(scb) && __cs_conn(scb)->xprt && __cs_conn(scb)->xprt->rcv_pipe &&
-            __cs_conn(scb)->mux && __cs_conn(scb)->mux->rcv_pipe) &&
+           (sc_conn(scf) && __sc_conn(scf)->xprt && __sc_conn(scf)->xprt->snd_pipe &&
+            __sc_conn(scf)->mux && __sc_conn(scf)->mux->snd_pipe) &&
+           (sc_conn(scb) && __sc_conn(scb)->xprt && __sc_conn(scb)->xprt->rcv_pipe &&
+            __sc_conn(scb)->mux && __sc_conn(scb)->mux->rcv_pipe) &&
            (pipes_used < global.maxpipes) &&
            (((sess->fe->options2|s->be->options2) & PR_O2_SPLIC_RTR) ||
             (((sess->fe->options2|s->be->options2) & PR_O2_SPLIC_AUT) &&
@@ -2527,8 +2527,8 @@ struct task *process_stream(struct task *t, void *context, unsigned int state)
                     (!(global.mode & MODE_QUIET) || (global.mode & MODE_VERBOSE)))) {
                chunk_printf(&trash, "%08x:%s.closed[%04x:%04x]\n",
                             s->uniq_id, s->be->id,
-                            (unsigned short)conn_fd(cs_conn(scf)),
-                            (unsigned short)conn_fd(cs_conn(scb)));
+                            (unsigned short)conn_fd(sc_conn(scf)),
+                            (unsigned short)conn_fd(sc_conn(scb)));
                DISGUISE(write(1, trash.area, trash.data));
        }
 
@@ -2754,7 +2754,7 @@ void stream_dump(struct buffer *buf, const struct stream *s, const char *pfx, ch
        res = &s->res;
 
        scf = s->scf;
-       cof = cs_conn(scf);
+       cof = sc_conn(scf);
        acf = cs_appctx(scf);
        if (cof && cof->src && addr_to_str(cof->src, pn, sizeof(pn)) >= 0)
                src = pn;
@@ -2762,7 +2762,7 @@ void stream_dump(struct buffer *buf, const struct stream *s, const char *pfx, ch
                src = acf->applet->name;
 
        scb = s->scb;
-       cob = cs_conn(scb);
+       cob = sc_conn(scb);
        acb = cs_appctx(scb);
        srv = objt_server(s->target);
        if (srv)
@@ -3242,7 +3242,7 @@ static int stats_dump_full_strm_to_buffer(struct stconn *cs, struct stream *strm
                else
                        chunk_appendf(&trash, "  backend=<NONE> (id=-1 mode=-)");
 
-               conn = cs_conn(strm->scb);
+               conn = sc_conn(strm->scb);
                switch (conn && conn_get_src(conn) ? addr_to_str(conn->src, pn, sizeof(pn)) : AF_UNSPEC) {
                case AF_INET:
                case AF_INET6:
@@ -3310,7 +3310,7 @@ static int stats_dump_full_strm_to_buffer(struct stconn *cs, struct stream *strm
                              (sc_ep_test(scf, SE_FL_T_MUX) ? "CONN" : (sc_ep_test(scf, SE_FL_T_APPLET) ? "APPCTX" : "NONE")),
                              scf->sedesc->se, sc_ep_get(scf), scf->wait_event.events);
 
-               if ((conn = cs_conn(scf)) != NULL) {
+               if ((conn = sc_conn(scf)) != NULL) {
                        chunk_appendf(&trash,
                                      "      co0=%p ctrl=%s xprt=%s mux=%s data=%s target=%s:%p\n",
                                      conn,
@@ -3349,7 +3349,7 @@ static int stats_dump_full_strm_to_buffer(struct stconn *cs, struct stream *strm
                              (sc_ep_test(scb, SE_FL_T_MUX) ? "CONN" : (sc_ep_test(scb, SE_FL_T_APPLET) ? "APPCTX" : "NONE")),
                              scb->sedesc->se, sc_ep_get(scb), scb->wait_event.events);
 
-               if ((conn = cs_conn(scb)) != NULL) {
+               if ((conn = sc_conn(scb)) != NULL) {
                        chunk_appendf(&trash,
                                      "      co1=%p ctrl=%s xprt=%s mux=%s data=%s target=%s:%p\n",
                                      conn,
@@ -3679,14 +3679,14 @@ static int cli_io_handler_dump_sess(struct appctx *appctx)
                             human_time(TICKS_TO_MS(curr_strm->res.analyse_exp - now_ms),
                                        TICKS_TO_MS(1000)) : "");
 
-               conn = cs_conn(curr_strm->scf);
+               conn = sc_conn(curr_strm->scf);
                chunk_appendf(&trash,
                             " scf=[%d,%1xh,fd=%d]",
                              curr_strm->scf->state,
                             curr_strm->scf->flags,
                             conn_fd(conn));
 
-               conn = cs_conn(curr_strm->scb);
+               conn = sc_conn(curr_strm->scb);
                chunk_appendf(&trash,
                             " scb=[%d,%1xh,fd=%d]",
                              curr_strm->scb->state,
index d313d5dbfb6c09d312961834c6cbaeba791e290e..272159e40632f74844ceccdc865b1cef37a3fc67 100644 (file)
@@ -52,8 +52,8 @@ smp_fetch_src(const struct arg *args, struct sample *smp, const char *kw, void *
 
        if (kw[0] == 'b') { /* bc_src */
                struct connection *conn = ((obj_type(smp->sess->origin) == OBJ_TYPE_CHECK)
-                                          ? cs_conn(__objt_check(smp->sess->origin)->cs)
-                                          : (smp->strm ? cs_conn(smp->strm->scb): NULL));
+                                          ? sc_conn(__objt_check(smp->sess->origin)->cs)
+                                          : (smp->strm ? sc_conn(smp->strm->scb): NULL));
                if (conn && conn_get_src(conn))
                        src = conn_src(conn);
        }
@@ -96,8 +96,8 @@ smp_fetch_sport(const struct arg *args, struct sample *smp, const char *kw, void
 
        if (kw[0] == 'b') { /* bc_src_port */
                struct connection *conn = ((obj_type(smp->sess->origin) == OBJ_TYPE_CHECK)
-                                          ? cs_conn(__objt_check(smp->sess->origin)->cs)
-                                          : (smp->strm ? cs_conn(smp->strm->scb): NULL));
+                                          ? sc_conn(__objt_check(smp->sess->origin)->cs)
+                                          : (smp->strm ? sc_conn(smp->strm->scb): NULL));
                if (conn && conn_get_src(conn))
                        src = conn_src(conn);
        }
@@ -131,8 +131,8 @@ smp_fetch_dst(const struct arg *args, struct sample *smp, const char *kw, void *
 
        if (kw[0] == 'b') { /* bc_dst */
                struct connection *conn = ((obj_type(smp->sess->origin) == OBJ_TYPE_CHECK)
-                                          ? cs_conn(__objt_check(smp->sess->origin)->cs)
-                                          : (smp->strm ? cs_conn(smp->strm->scb): NULL));
+                                          ? sc_conn(__objt_check(smp->sess->origin)->cs)
+                                          : (smp->strm ? sc_conn(smp->strm->scb): NULL));
                if (conn && conn_get_dst(conn))
                        dst = conn_dst(conn);
        }
@@ -227,8 +227,8 @@ smp_fetch_dport(const struct arg *args, struct sample *smp, const char *kw, void
 
        if (kw[0] == 'b') { /* bc_dst_port */
                struct connection *conn = ((obj_type(smp->sess->origin) == OBJ_TYPE_CHECK)
-                                          ? cs_conn(__objt_check(smp->sess->origin)->cs)
-                                          : (smp->strm ? cs_conn(smp->strm->scb): NULL));
+                                          ? sc_conn(__objt_check(smp->sess->origin)->cs)
+                                          : (smp->strm ? sc_conn(smp->strm->scb): NULL));
                if (conn && conn_get_dst(conn))
                        dst = conn_dst(conn);
        }
@@ -325,7 +325,7 @@ static inline int get_tcp_info(const struct arg *args, struct sample *smp,
         * object can be other thing than a connection. For example,
         * it be a appctx.
         */
-       conn = (dir == 0 ? cs_conn(smp->strm->scf) : cs_conn(smp->strm->scb));
+       conn = (dir == 0 ? sc_conn(smp->strm->scf) : sc_conn(smp->strm->scb));
        if (!conn)
                return 0;
 
index df420b5d8f3c4055eea0f87acbced2a8dfaa294c..d0d05256b7671049d9fdfb89c21e94f22eb64202 100644 (file)
@@ -1056,7 +1056,7 @@ enum tcpcheck_eval_ret tcpcheck_eval_connect(struct check *check, struct tcpchec
        struct proxy *proxy = check->proxy;
        struct server *s = check->server;
        struct task *t = check->task;
-       struct connection *conn = cs_conn(check->cs);
+       struct connection *conn = sc_conn(check->cs);
        struct protocol *proto;
        struct xprt_ops *xprt;
        struct tcpcheck_rule *next;
@@ -1325,7 +1325,7 @@ enum tcpcheck_eval_ret tcpcheck_eval_send(struct check *check, struct tcpcheck_r
        enum tcpcheck_eval_ret ret = TCPCHK_EVAL_CONTINUE;
        struct tcpcheck_send *send = &rule->send;
        struct stconn *cs = check->cs;
-       struct connection *conn = __cs_conn(cs);
+       struct connection *conn = __sc_conn(cs);
        struct buffer *tmp = NULL;
        struct htx *htx = NULL;
        int connection_hdr = 0;
@@ -1535,7 +1535,7 @@ enum tcpcheck_eval_ret tcpcheck_eval_send(struct check *check, struct tcpcheck_r
 enum tcpcheck_eval_ret tcpcheck_eval_recv(struct check *check, struct tcpcheck_rule *rule)
 {
        struct stconn *cs = check->cs;
-       struct connection *conn = __cs_conn(cs);
+       struct connection *conn = __sc_conn(cs);
        enum tcpcheck_eval_ret ret = TCPCHK_EVAL_CONTINUE;
        size_t max, read, cur_read = 0;
        int is_empty;
@@ -2126,7 +2126,7 @@ int tcpcheck_main(struct check *check)
 {
        struct tcpcheck_rule *rule;
        struct stconn *cs = check->cs;
-       struct connection *conn = cs_conn(cs);
+       struct connection *conn = sc_conn(cs);
        int must_read = 1, last_read = 0;
        int retcode = 0;
        enum tcpcheck_eval_ret eval_ret;
@@ -2188,7 +2188,7 @@ int tcpcheck_main(struct check *check)
                switch (rule->action) {
                case TCPCHK_ACT_CONNECT:
                        /* Not the first connection, release it first */
-                       if (cs_conn(cs) && check->current_step != rule) {
+                       if (sc_conn(cs) && check->current_step != rule) {
                                check->state |= CHK_ST_CLOSE_CONN;
                                retcode = -1;
                        }
@@ -2206,7 +2206,7 @@ int tcpcheck_main(struct check *check)
                        eval_ret = tcpcheck_eval_connect(check, rule);
 
                        /* Refresh connection */
-                       conn = cs_conn(cs);
+                       conn = sc_conn(cs);
                        last_read = 0;
                        must_read = (IS_HTX_CS(cs) ? htx_is_empty(htxbuf(&check->bi)) : !b_data(&check->bi));
                        break;