diff --git a/include/haproxy/conn_stream.h b/include/haproxy/conn_stream.h index cad043aec..30ef61b36 100644 --- a/include/haproxy/conn_stream.h +++ b/include/haproxy/conn_stream.h @@ -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; diff --git a/include/haproxy/cs_utils.h b/include/haproxy/cs_utils.h index db6cde61e..b263985f6 100644 --- a/include/haproxy/cs_utils.h +++ b/include/haproxy/cs_utils.h @@ -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); diff --git a/src/backend.c b/src/backend.c index 83b3bf1ef..131e5a403 100644 --- a/src/backend.c +++ b/src/backend.c @@ -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); diff --git a/src/check.c b/src/check.c index 7aafb79a1..20ed5b4fa 100644 --- a/src/check.c +++ b/src/check.c @@ -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. diff --git a/src/cli.c b/src/cli.c index e388d82f2..b91b39280 100644 --- 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 }; diff --git a/src/conn_stream.c b/src/conn_stream.c index 98137b884..06b147343 100644 --- a/src/conn_stream.c +++ b/src/conn_stream.c @@ -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))) diff --git a/src/connection.c b/src/connection.c index 53ac9a665..f3775e85f 100644 --- a/src/connection.c +++ b/src/connection.c @@ -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; diff --git a/src/frontend.c b/src/frontend.c index d2e949d41..48c654b74 100644 --- a/src/frontend.c +++ b/src/frontend.c @@ -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); diff --git a/src/hlua.c b/src/hlua.c index 64b0527f3..1fdfcf3d1 100644 --- a/src/hlua.c +++ b/src/hlua.c @@ -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); diff --git a/src/http_ana.c b/src/http_ana.c index 308b7d666..55c0a3417 100644 --- a/src/http_ana.c +++ b/src/http_ana.c @@ -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); diff --git a/src/log.c b/src/log.c index 6eade9aee..a868a7ec4 100644 --- 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); diff --git a/src/mux_pt.c b/src/mux_pt.c index cbfc78953..b8a375e13 100644 --- a/src/mux_pt.c +++ b/src/mux_pt.c @@ -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; diff --git a/src/ssl_sample.c b/src/ssl_sample.c index ea5677c65..9031dc498 100644 --- a/src/ssl_sample.c +++ b/src/ssl_sample.c @@ -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); diff --git a/src/stream.c b/src/stream.c index 1c7c0d660..51e18d311 100644 --- a/src/stream.c +++ b/src/stream.c @@ -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= (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, diff --git a/src/tcp_sample.c b/src/tcp_sample.c index d313d5dbf..272159e40 100644 --- a/src/tcp_sample.c +++ b/src/tcp_sample.c @@ -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; diff --git a/src/tcpcheck.c b/src/tcpcheck.c index df420b5d8..d0d05256b 100644 --- a/src/tcpcheck.c +++ b/src/tcpcheck.c @@ -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;