diff --git a/addons/promex/service-prometheus.c b/addons/promex/service-prometheus.c index 5e9cca23a4..d27aefaaaa 100644 --- a/addons/promex/service-prometheus.c +++ b/addons/promex/service-prometheus.c @@ -558,7 +558,7 @@ static int promex_dump_global_metrics(struct appctx *appctx, struct htx *htx) static struct ist prefix = IST("haproxy_process_"); struct promex_ctx *ctx = appctx->svcctx; struct field val; - struct channel *chn = sc_ic(appctx_cs(appctx)); + struct channel *chn = sc_ic(appctx_sc(appctx)); struct ist out = ist2(trash.area, 0); size_t max = htx_get_max_blksz(htx, channel_htx_recv_max(chn, htx)); int ret = 1; @@ -610,7 +610,7 @@ static int promex_dump_front_metrics(struct appctx *appctx, struct htx *htx) struct promex_ctx *ctx = appctx->svcctx; struct proxy *px; struct field val; - struct channel *chn = sc_ic(appctx_cs(appctx)); + struct channel *chn = sc_ic(appctx_sc(appctx)); struct ist out = ist2(trash.area, 0); size_t max = htx_get_max_blksz(htx, channel_htx_recv_max(chn, htx)); struct field *stats = stat_l[STATS_DOMAIN_PROXY]; @@ -711,7 +711,7 @@ static int promex_dump_listener_metrics(struct appctx *appctx, struct htx *htx) struct promex_ctx *ctx = appctx->svcctx; struct proxy *px; struct field val; - struct channel *chn = sc_ic(appctx_cs(appctx)); + struct channel *chn = sc_ic(appctx_sc(appctx)); struct ist out = ist2(trash.area, 0); size_t max = htx_get_max_blksz(htx, channel_htx_recv_max(chn, htx)); struct field *stats = stat_l[STATS_DOMAIN_PROXY]; @@ -803,7 +803,7 @@ static int promex_dump_back_metrics(struct appctx *appctx, struct htx *htx) struct proxy *px; struct server *sv; struct field val; - struct channel *chn = sc_ic(appctx_cs(appctx)); + struct channel *chn = sc_ic(appctx_sc(appctx)); struct ist out = ist2(trash.area, 0); size_t max = htx_get_max_blksz(htx, channel_htx_recv_max(chn, htx)); struct field *stats = stat_l[STATS_DOMAIN_PROXY]; @@ -957,7 +957,7 @@ static int promex_dump_srv_metrics(struct appctx *appctx, struct htx *htx) struct proxy *px; struct server *sv; struct field val; - struct channel *chn = sc_ic(appctx_cs(appctx)); + struct channel *chn = sc_ic(appctx_sc(appctx)); struct ist out = ist2(trash.area, 0); size_t max = htx_get_max_blksz(htx, channel_htx_recv_max(chn, htx)); struct field *stats = stat_l[STATS_DOMAIN_PROXY]; @@ -1127,7 +1127,7 @@ static int promex_dump_sticktable_metrics(struct appctx *appctx, struct htx *htx static struct ist prefix = IST("haproxy_sticktable_"); struct promex_ctx *ctx = appctx->svcctx; struct field val; - struct channel *chn = sc_ic(appctx_cs(appctx)); + struct channel *chn = sc_ic(appctx_sc(appctx)); struct ist out = ist2(trash.area, 0); size_t max = htx_get_max_blksz(htx, channel_htx_recv_max(chn, htx)); int ret = 1; @@ -1503,7 +1503,7 @@ static int promex_appctx_init(struct appctx *appctx) /* The main I/O handler for the promex applet. */ static void promex_appctx_handle_io(struct appctx *appctx) { - struct stconn *sc = appctx_cs(appctx); + struct stconn *sc = appctx_sc(appctx); struct stream *s = __sc_strm(sc); struct channel *req = sc_oc(sc); struct channel *res = sc_ic(sc); diff --git a/include/haproxy/applet.h b/include/haproxy/applet.h index 776a4015a3..01835d7d29 100644 --- a/include/haproxy/applet.h +++ b/include/haproxy/applet.h @@ -115,7 +115,7 @@ static inline void appctx_wakeup(struct appctx *appctx) } /* returns the stream connector the appctx is attached to, via the sedesc */ -static inline struct stconn *appctx_cs(const struct appctx *appctx) +static inline struct stconn *appctx_sc(const struct appctx *appctx) { return appctx->sedesc->sc; } diff --git a/src/activity.c b/src/activity.c index 4d55f914ff..10ee65dc21 100644 --- a/src/activity.c +++ b/src/activity.c @@ -621,7 +621,7 @@ static int cli_io_handler_show_profiling(struct appctx *appctx) unsigned long long tot_alloc_calls, tot_free_calls; unsigned long long tot_alloc_bytes, tot_free_bytes; #endif - struct stconn *sc = appctx_cs(appctx); + struct stconn *sc = appctx_sc(appctx); struct buffer *name_buffer = get_trash_chunk(); const char *str; int max_lines; @@ -840,7 +840,7 @@ static int cli_parse_show_profiling(char **args, char *payload, struct appctx *a static int cli_io_handler_show_tasks(struct appctx *appctx) { struct sched_activity tmp_activity[256] __attribute__((aligned(64))); - struct stconn *sc = appctx_cs(appctx); + struct stconn *sc = appctx_sc(appctx); struct buffer *name_buffer = get_trash_chunk(); struct sched_activity *entry; const struct tasklet *tl; diff --git a/src/applet.c b/src/applet.c index 7ec026e54c..2b015a01ab 100644 --- a/src/applet.c +++ b/src/applet.c @@ -114,7 +114,7 @@ void appctx_free_on_early_error(struct appctx *appctx) /* If a frontend appctx is attached to a stream connector, release the stream * instead of the appctx. */ - if (!se_fl_test(appctx->sedesc, SE_FL_ORPHAN) && !(appctx_cs(appctx)->flags & SC_FL_ISBACK)) { + if (!se_fl_test(appctx->sedesc, SE_FL_ORPHAN) && !(appctx_sc(appctx)->flags & SC_FL_ISBACK)) { stream_free(appctx_strm(appctx)); return; } @@ -164,7 +164,7 @@ void appctx_shut(struct appctx *appctx) int appctx_buf_available(void *arg) { struct appctx *appctx = arg; - struct stconn *sc = appctx_cs(appctx); + struct stconn *sc = appctx_sc(appctx); /* allocation requested ? */ if (!(sc->flags & SC_FL_NEED_BUFF)) @@ -209,10 +209,10 @@ struct task *task_run_applet(struct task *t, void *context, unsigned int state) appctx_free_on_early_error(app); return NULL; } - BUG_ON(!app->sess || !appctx_cs(app) || !appctx_strm(app)); + BUG_ON(!app->sess || !appctx_sc(app) || !appctx_strm(app)); } - sc = appctx_cs(app); + sc = appctx_sc(app); /* We always pretend the applet can't get and doesn't want to * put, it's up to it to change this if needed. This ensures diff --git a/src/cache.c b/src/cache.c index 98c2ecefe8..604d98d20f 100644 --- a/src/cache.c +++ b/src/cache.c @@ -1294,7 +1294,7 @@ static unsigned int htx_cache_dump_blk(struct appctx *appctx, struct htx *htx, e uint32_t blksz; max = htx_get_max_blksz(htx, - channel_htx_recv_max(sc_ic(appctx_cs(appctx)), htx)); + channel_htx_recv_max(sc_ic(appctx_sc(appctx)), htx)); if (!max) return 0; blksz = ((type == HTX_BLK_HDR || type == HTX_BLK_TLR) @@ -1338,7 +1338,7 @@ static unsigned int htx_cache_dump_data_blk(struct appctx *appctx, struct htx *h uint32_t blksz; max = htx_get_max_blksz(htx, - channel_htx_recv_max(sc_ic(appctx_cs(appctx)), htx)); + channel_htx_recv_max(sc_ic(appctx_sc(appctx)), htx)); if (!max) return 0; @@ -1455,7 +1455,7 @@ static void http_cache_io_handler(struct appctx *appctx) struct cache_appctx *ctx = appctx->svcctx; struct cache_entry *cache_ptr = ctx->entry; struct shared_block *first = block_ptr(cache_ptr); - struct stconn *sc = appctx_cs(appctx); + struct stconn *sc = appctx_sc(appctx); struct channel *req = sc_oc(sc); struct channel *res = sc_ic(sc); struct htx *req_htx, *res_htx; diff --git a/src/cli.c b/src/cli.c index 242ad7acd5..5cb34cbf43 100644 --- a/src/cli.c +++ b/src/cli.c @@ -897,7 +897,7 @@ static int cli_output_msg(struct channel *chn, const char *msg, int severity, in */ static void cli_io_handler(struct appctx *appctx) { - struct stconn *sc = appctx_cs(appctx); + struct stconn *sc = appctx_sc(appctx); struct channel *req = sc_oc(sc); struct channel *res = sc_ic(sc); struct bind_conf *bind_conf = strm_li(__sc_strm(sc))->bind_conf; @@ -1224,7 +1224,7 @@ static void cli_release_handler(struct appctx *appctx) static int cli_io_handler_show_env(struct appctx *appctx) { struct show_env_ctx *ctx = appctx->svcctx; - struct stconn *sc = appctx_cs(appctx); + struct stconn *sc = appctx_sc(appctx); char **var = ctx->var; if (unlikely(sc_ic(sc)->flags & (CF_WRITE_ERROR|CF_SHUTW))) @@ -1259,7 +1259,7 @@ static int cli_io_handler_show_env(struct appctx *appctx) */ static int cli_io_handler_show_fd(struct appctx *appctx) { - struct stconn *sc = appctx_cs(appctx); + struct stconn *sc = appctx_sc(appctx); struct show_fd_ctx *fdctx = appctx->svcctx; int fd = fdctx->fd; int ret = 1; @@ -1458,7 +1458,7 @@ static int cli_io_handler_show_fd(struct appctx *appctx) */ static int cli_io_handler_show_activity(struct appctx *appctx) { - struct stconn *sc = appctx_cs(appctx); + struct stconn *sc = appctx_sc(appctx); int thr; if (unlikely(sc_ic(sc)->flags & (CF_WRITE_ERROR|CF_SHUTW))) @@ -1969,7 +1969,7 @@ static int _getsocks(char **args, char *payload, struct appctx *appctx, void *pr char *cmsgbuf = NULL; unsigned char *tmpbuf = NULL; struct cmsghdr *cmsg; - struct stconn *sc = appctx_cs(appctx); + struct stconn *sc = appctx_sc(appctx); struct stream *s = __sc_strm(sc); struct connection *remote = sc_conn(sc_opposite(sc)); struct msghdr msghdr; diff --git a/src/debug.c b/src/debug.c index 72b6720789..9a5c2946bc 100644 --- a/src/debug.c +++ b/src/debug.c @@ -251,7 +251,7 @@ void ha_task_dump(struct buffer *buf, const struct task *task, const char *pfx) if (task->process == process_stream && task->context) s = (struct stream *)task->context; else if (task->process == task_run_applet && task->context) - s = sc_strm(appctx_cs((struct appctx *)task->context)); + s = sc_strm(appctx_sc((struct appctx *)task->context)); else if (task->process == sc_conn_io_cb && task->context) s = sc_strm(((struct stconn *)task->context)); @@ -290,7 +290,7 @@ void ha_task_dump(struct buffer *buf, const struct task *task, const char *pfx) */ static int cli_io_handler_show_threads(struct appctx *appctx) { - struct stconn *sc = appctx_cs(appctx); + struct stconn *sc = appctx_sc(appctx); int thr; if (unlikely(sc_ic(sc)->flags & (CF_WRITE_ERROR|CF_SHUTW))) @@ -1043,7 +1043,7 @@ static int debug_parse_cli_fd(char **args, char *payload, struct appctx *appctx, static int debug_iohandler_fd(struct appctx *appctx) { struct dev_fd_ctx *ctx = appctx->svcctx; - struct stconn *sc = appctx_cs(appctx); + struct stconn *sc = appctx_sc(appctx); struct sockaddr_storage sa; struct stat statbuf; socklen_t salen, vlen; @@ -1237,7 +1237,7 @@ static int debug_parse_cli_memstats(char **args, char *payload, struct appctx *a static int debug_iohandler_memstats(struct appctx *appctx) { struct dev_mem_ctx *ctx = appctx->svcctx; - struct stconn *sc = appctx_cs(appctx); + struct stconn *sc = appctx_sc(appctx); struct mem_stats *ptr = ctx->start; int ret = 1; diff --git a/src/dns.c b/src/dns.c index 1a283bf30e..710cd5cb52 100644 --- a/src/dns.c +++ b/src/dns.c @@ -438,7 +438,7 @@ int dns_dgram_init(struct dns_nameserver *ns, struct sockaddr_storage *sk) */ static void dns_session_io_handler(struct appctx *appctx) { - struct stconn *sc = appctx_cs(appctx); + struct stconn *sc = appctx_sc(appctx); struct dns_session *ds = appctx->svcctx; struct ring *ring = &ds->ring; struct buffer *buf = &ring->buf; diff --git a/src/flt_spoe.c b/src/flt_spoe.c index 9c92451660..9973123f54 100644 --- a/src/flt_spoe.c +++ b/src/flt_spoe.c @@ -1137,7 +1137,7 @@ spoe_handle_healthcheck_response(char *frame, size_t size, char *err, int errlen static int spoe_send_frame(struct appctx *appctx, char *buf, size_t framesz) { - struct stconn *sc = appctx_cs(appctx); + struct stconn *sc = appctx_sc(appctx); int ret; uint32_t netint; @@ -1164,7 +1164,7 @@ spoe_send_frame(struct appctx *appctx, char *buf, size_t framesz) static int spoe_recv_frame(struct appctx *appctx, char *buf, size_t framesz) { - struct stconn *sc = appctx_cs(appctx); + struct stconn *sc = appctx_sc(appctx); int ret; uint32_t netint; @@ -1266,7 +1266,7 @@ spoe_init_appctx(struct appctx *appctx) static void spoe_release_appctx(struct appctx *appctx) { - struct stconn *sc = appctx_cs(appctx); + struct stconn *sc = appctx_sc(appctx); struct spoe_appctx *spoe_appctx = SPOE_APPCTX(appctx); struct spoe_agent *agent; struct spoe_context *ctx, *back; @@ -1386,7 +1386,7 @@ spoe_release_appctx(struct appctx *appctx) static int spoe_handle_connect_appctx(struct appctx *appctx) { - struct stconn *sc = appctx_cs(appctx); + struct stconn *sc = appctx_sc(appctx); struct spoe_agent *agent = SPOE_APPCTX(appctx)->agent; char *frame, *buf; int ret; @@ -1452,7 +1452,7 @@ spoe_handle_connect_appctx(struct appctx *appctx) static int spoe_handle_connecting_appctx(struct appctx *appctx) { - struct stconn *sc = appctx_cs(appctx); + struct stconn *sc = appctx_sc(appctx); struct spoe_agent *agent = SPOE_APPCTX(appctx)->agent; char *frame; int ret; @@ -1697,7 +1697,7 @@ spoe_handle_receiving_frame_appctx(struct appctx *appctx, int *skip) /* Do not forget to remove processed frame from the output buffer */ if (trash.data) - co_skip(sc_oc(appctx_cs(appctx)), trash.data); + co_skip(sc_oc(appctx_sc(appctx)), trash.data); end: return ret; } @@ -1705,7 +1705,7 @@ spoe_handle_receiving_frame_appctx(struct appctx *appctx, int *skip) static int spoe_handle_processing_appctx(struct appctx *appctx) { - struct stconn *sc = appctx_cs(appctx); + struct stconn *sc = appctx_sc(appctx); struct server *srv = objt_server(__sc_strm(sc)->target); struct spoe_agent *agent = SPOE_APPCTX(appctx)->agent; int ret, skip_sending = 0, skip_receiving = 0, active_s = 0, active_r = 0, close_asap = 0; @@ -1828,7 +1828,7 @@ spoe_handle_processing_appctx(struct appctx *appctx) static int spoe_handle_disconnect_appctx(struct appctx *appctx) { - struct stconn *sc = appctx_cs(appctx); + struct stconn *sc = appctx_sc(appctx); struct spoe_agent *agent = SPOE_APPCTX(appctx)->agent; char *frame, *buf; int ret; @@ -1881,7 +1881,7 @@ spoe_handle_disconnect_appctx(struct appctx *appctx) static int spoe_handle_disconnecting_appctx(struct appctx *appctx) { - struct stconn *sc = appctx_cs(appctx); + struct stconn *sc = appctx_sc(appctx); char *frame; int ret; @@ -1946,7 +1946,7 @@ spoe_handle_disconnecting_appctx(struct appctx *appctx) static void spoe_handle_appctx(struct appctx *appctx) { - struct stconn *sc = appctx_cs(appctx); + struct stconn *sc = appctx_sc(appctx); struct spoe_agent *agent; if (SPOE_APPCTX(appctx) == NULL) diff --git a/src/hlua.c b/src/hlua.c index 375b034dc4..c2f0382830 100644 --- a/src/hlua.c +++ b/src/hlua.c @@ -1933,7 +1933,7 @@ __LJMP static struct hlua_socket *hlua_checksocket(lua_State *L, int ud) static void hlua_socket_handler(struct appctx *appctx) { struct hlua_csk_ctx *ctx = appctx->svcctx; - struct stconn *sc = appctx_cs(appctx); + struct stconn *sc = appctx_sc(appctx); if (ctx->die) { sc_shutw(sc); @@ -2401,7 +2401,7 @@ static int hlua_socket_write_yield(struct lua_State *L,int status, lua_KContext csk_ctx = container_of(peer, struct hlua_csk_ctx, xref); appctx = csk_ctx->appctx; - sc = appctx_cs(appctx); + sc = appctx_sc(appctx); s = __sc_strm(sc); /* Check for connection close. */ @@ -2635,7 +2635,7 @@ __LJMP static int hlua_socket_getpeername(struct lua_State *L) } appctx = container_of(peer, struct hlua_csk_ctx, xref)->appctx; - sc = appctx_cs(appctx); + sc = appctx_sc(appctx); dst = sc_dst(sc_opposite(sc)); if (!dst) { xref_unlock(&socket->xref, peer); @@ -2842,7 +2842,7 @@ __LJMP static int hlua_socket_connect(struct lua_State *L) csk_ctx = container_of(peer, struct hlua_csk_ctx, xref); appctx = csk_ctx->appctx; - sc = appctx_cs(appctx); + sc = appctx_sc(appctx); s = __sc_strm(sc); if (!sockaddr_alloc(&sc_opposite(sc)->dst, addr, sizeof(*addr))) { @@ -4479,7 +4479,7 @@ __LJMP static int hlua_applet_tcp_get_priv(lua_State *L) __LJMP static int hlua_applet_tcp_getline_yield(lua_State *L, int status, lua_KContext ctx) { struct hlua_appctx *luactx = MAY_LJMP(hlua_checkapplet_tcp(L, 1)); - struct stconn *sc = appctx_cs(luactx->appctx); + struct stconn *sc = appctx_sc(luactx->appctx); int ret; const char *blk1; size_t len1; @@ -4533,7 +4533,7 @@ __LJMP static int hlua_applet_tcp_getline(lua_State *L) __LJMP static int hlua_applet_tcp_recv_yield(lua_State *L, int status, lua_KContext ctx) { struct hlua_appctx *luactx = MAY_LJMP(hlua_checkapplet_tcp(L, 1)); - struct stconn *sc = appctx_cs(luactx->appctx); + struct stconn *sc = appctx_sc(luactx->appctx); size_t len = MAY_LJMP(luaL_checkinteger(L, 2)); int ret; const char *blk1; @@ -4641,7 +4641,7 @@ __LJMP static int hlua_applet_tcp_send_yield(lua_State *L, int status, lua_KCont struct hlua_appctx *luactx = MAY_LJMP(hlua_checkapplet_tcp(L, 1)); const char *str = MAY_LJMP(luaL_checklstring(L, 2, &len)); int l = MAY_LJMP(luaL_checkinteger(L, 3)); - struct stconn *sc = appctx_cs(luactx->appctx); + struct stconn *sc = appctx_sc(luactx->appctx); struct channel *chn = sc_ic(sc); int max; @@ -4968,7 +4968,7 @@ __LJMP static int hlua_applet_http_get_priv(lua_State *L) __LJMP static int hlua_applet_http_getline_yield(lua_State *L, int status, lua_KContext ctx) { struct hlua_appctx *luactx = MAY_LJMP(hlua_checkapplet_http(L, 1)); - struct stconn *sc = appctx_cs(luactx->appctx); + struct stconn *sc = appctx_sc(luactx->appctx); struct channel *req = sc_oc(sc); struct htx *htx; struct htx_blk *blk; @@ -5063,7 +5063,7 @@ __LJMP static int hlua_applet_http_getline(lua_State *L) __LJMP static int hlua_applet_http_recv_yield(lua_State *L, int status, lua_KContext ctx) { struct hlua_appctx *luactx = MAY_LJMP(hlua_checkapplet_http(L, 1)); - struct stconn *sc = appctx_cs(luactx->appctx); + struct stconn *sc = appctx_sc(luactx->appctx); struct channel *req = sc_oc(sc); struct htx *htx; struct htx_blk *blk; @@ -5172,7 +5172,7 @@ __LJMP static int hlua_applet_http_recv(lua_State *L) __LJMP static int hlua_applet_http_send_yield(lua_State *L, int status, lua_KContext ctx) { struct hlua_appctx *luactx = MAY_LJMP(hlua_checkapplet_http(L, 1)); - struct stconn *sc = appctx_cs(luactx->appctx); + struct stconn *sc = appctx_sc(luactx->appctx); struct channel *res = sc_ic(sc); struct htx *htx = htx_from_buf(&res->buf); const char *data; @@ -5309,7 +5309,7 @@ __LJMP static int hlua_applet_http_send_response(lua_State *L) { struct hlua_appctx *luactx = MAY_LJMP(hlua_checkapplet_http(L, 1)); struct hlua_http_ctx *http_ctx = luactx->appctx->svcctx; - struct stconn *sc = appctx_cs(luactx->appctx); + struct stconn *sc = appctx_sc(luactx->appctx); struct channel *res = sc_ic(sc); struct htx *htx; struct htx_sl *sl; @@ -5506,7 +5506,7 @@ __LJMP static int hlua_applet_http_send_response(lua_State *L) __LJMP static int hlua_applet_http_start_response_yield(lua_State *L, int status, lua_KContext ctx) { struct hlua_appctx *luactx = MAY_LJMP(hlua_checkapplet_http(L, 1)); - struct stconn *sc = appctx_cs(luactx->appctx); + struct stconn *sc = appctx_sc(luactx->appctx); struct channel *res = sc_ic(sc); if (co_data(res)) { @@ -9216,7 +9216,7 @@ struct task *hlua_applet_wakeup(struct task *t, void *context, unsigned int stat static int hlua_applet_tcp_init(struct appctx *ctx) { struct hlua_tcp_ctx *tcp_ctx = applet_reserve_svcctx(ctx, sizeof(*tcp_ctx)); - struct stconn *sc = appctx_cs(ctx); + struct stconn *sc = appctx_sc(ctx); struct stream *strm = __sc_strm(sc); struct hlua *hlua; struct task *task; @@ -9314,7 +9314,7 @@ static int hlua_applet_tcp_init(struct appctx *ctx) void hlua_applet_tcp_fct(struct appctx *ctx) { struct hlua_tcp_ctx *tcp_ctx = ctx->svcctx; - struct stconn *sc = appctx_cs(ctx); + struct stconn *sc = appctx_sc(ctx); struct stream *strm = __sc_strm(sc); struct channel *res = sc_ic(sc); struct act_rule *rule = ctx->rule; @@ -9407,7 +9407,7 @@ static void hlua_applet_tcp_release(struct appctx *ctx) static int hlua_applet_http_init(struct appctx *ctx) { struct hlua_http_ctx *http_ctx = applet_reserve_svcctx(ctx, sizeof(*http_ctx)); - struct stconn *sc = appctx_cs(ctx); + struct stconn *sc = appctx_sc(ctx); struct stream *strm = __sc_strm(sc); struct http_txn *txn; struct hlua *hlua; @@ -9510,7 +9510,7 @@ static int hlua_applet_http_init(struct appctx *ctx) void hlua_applet_http_fct(struct appctx *ctx) { struct hlua_http_ctx *http_ctx = ctx->svcctx; - struct stconn *sc = appctx_cs(ctx); + struct stconn *sc = appctx_sc(ctx); struct stream *strm = __sc_strm(sc); struct channel *req = sc_oc(sc); struct channel *res = sc_ic(sc); @@ -10147,7 +10147,7 @@ static int hlua_cli_io_handler_fct(struct appctx *appctx) struct hlua_function *fcn; hlua = ctx->hlua; - sc = appctx_cs(appctx); + sc = appctx_sc(appctx); fcn = ctx->fcn; /* If the stream is disconnect or closed, ldo nothing. */ diff --git a/src/http_client.c b/src/http_client.c index f1b5488931..61cd3a08c4 100644 --- a/src/http_client.c +++ b/src/http_client.c @@ -195,7 +195,7 @@ static int hc_cli_parse(char **args, char *payload, struct appctx *appctx, void static int hc_cli_io_handler(struct appctx *appctx) { struct hcli_svc_ctx *ctx = appctx->svcctx; - struct stconn *sc = appctx_cs(appctx); + struct stconn *sc = appctx_sc(appctx); struct buffer *trash = alloc_trash_chunk(); struct httpclient *hc = ctx->hc; struct http_hdr *hdrs, *hdr; @@ -636,7 +636,7 @@ struct httpclient *httpclient_new(void *caller, enum http_meth_t meth, struct is static void httpclient_applet_io_handler(struct appctx *appctx) { struct httpclient *hc = appctx->svcctx; - struct stconn *sc = appctx_cs(appctx); + struct stconn *sc = appctx_sc(appctx); struct stream *s = __sc_strm(sc); struct channel *req = &s->req; struct channel *res = &s->res; diff --git a/src/log.c b/src/log.c index c6dbc5e217..e25d2e79df 100644 --- a/src/log.c +++ b/src/log.c @@ -3559,7 +3559,7 @@ void syslog_fd_handler(int fd) static void syslog_io_handler(struct appctx *appctx) { static THREAD_LOCAL struct ist metadata[LOG_META_FIELDS]; - struct stconn *sc = appctx_cs(appctx); + struct stconn *sc = appctx_sc(appctx); struct stream *s = __sc_strm(sc); struct proxy *frontend = strm_fe(s); struct listener *l = strm_li(s); diff --git a/src/map.c b/src/map.c index 8308a7a4fd..52ddb5c7fc 100644 --- a/src/map.c +++ b/src/map.c @@ -345,7 +345,7 @@ struct show_map_ctx { static int cli_io_handler_pat_list(struct appctx *appctx) { struct show_map_ctx *ctx = appctx->svcctx; - struct stconn *sc = appctx_cs(appctx); + struct stconn *sc = appctx_sc(appctx); struct pat_ref_elt *elt; if (unlikely(sc_ic(sc)->flags & (CF_WRITE_ERROR|CF_SHUTW))) { diff --git a/src/mworker.c b/src/mworker.c index e0a5df09af..6a4fce48c2 100644 --- a/src/mworker.c +++ b/src/mworker.c @@ -509,7 +509,7 @@ void mworker_cleanup_proc() /* Displays workers and processes */ static int cli_io_handler_show_proc(struct appctx *appctx) { - struct stconn *sc = appctx_cs(appctx); + struct stconn *sc = appctx_sc(appctx); struct mworker_proc *child; int old = 0; int up = now.tv_sec - proc_self->timestamp; diff --git a/src/peers.c b/src/peers.c index 6718034f1e..da83a79996 100644 --- a/src/peers.c +++ b/src/peers.c @@ -1167,7 +1167,7 @@ static int peer_get_version(const char *str, */ static inline int peer_getline(struct appctx *appctx) { - struct stconn *sc = appctx_cs(appctx); + struct stconn *sc = appctx_sc(appctx); int n; n = co_getline(sc_oc(sc), trash.area, trash.size); @@ -1201,7 +1201,7 @@ static inline int peer_send_msg(struct appctx *appctx, struct peer_prep_params *params) { int ret, msglen; - struct stconn *sc = appctx_cs(appctx); + struct stconn *sc = appctx_sc(appctx); msglen = peer_prepare_msg(trash.area, trash.size, params); if (!msglen) { @@ -1681,7 +1681,7 @@ static inline int peer_send_teach_stage2_msgs(struct appctx *appctx, struct peer static int peer_treat_updatemsg(struct appctx *appctx, struct peer *p, int updt, int exp, char **msg_cur, char *msg_end, int msg_len, int totl) { - struct stconn *sc = appctx_cs(appctx); + struct stconn *sc = appctx_sc(appctx); struct shared_table *st = p->remote_table; struct stksess *ts, *newts; uint32_t update; @@ -2133,7 +2133,7 @@ static inline int peer_treat_switchmsg(struct appctx *appctx, struct peer *p, static inline int peer_treat_definemsg(struct appctx *appctx, struct peer *p, char **msg_cur, char *msg_end, int totl) { - struct stconn *sc = appctx_cs(appctx); + struct stconn *sc = appctx_sc(appctx); int table_id_len; struct shared_table *st; int table_type; @@ -2332,7 +2332,7 @@ static inline int peer_recv_msg(struct appctx *appctx, char *msg_head, size_t ms uint32_t *msg_len, int *totl) { int reql; - struct stconn *sc = appctx_cs(appctx); + struct stconn *sc = appctx_sc(appctx); char *cur; reql = co_getblk(sc_oc(sc), msg_head, 2 * sizeof(char), *totl); @@ -2850,7 +2850,7 @@ static inline void init_connected_peer(struct peer *peer, struct peers *peers) */ static void peer_io_handler(struct appctx *appctx) { - struct stconn *sc = appctx_cs(appctx); + struct stconn *sc = appctx_sc(appctx); struct stream *s = __sc_strm(sc); struct peers *curpeers = strm_fe(s)->parent; struct peer *curpeer = NULL; @@ -3817,7 +3817,7 @@ static int peers_dump_peer(struct buffer *msg, struct stconn *sc, struct peer *p chunk_appendf(&trash, " appctx:%p st0=%d st1=%d task_calls=%u", appctx, appctx->st0, appctx->st1, appctx->t ? appctx->t->calls : 0); - peer_cs = appctx_cs(peer->appctx); + peer_cs = appctx_sc(peer->appctx); peer_s = __sc_strm(peer_cs); chunk_appendf(&trash, " state=%s", sc_state_str(sc_opposite(peer_cs)->state)); @@ -3968,7 +3968,7 @@ static int cli_io_handler_show_peers(struct appctx *appctx) ctx->state = STATE_DONE; } else { - if (!peers_dump_peer(&trash, appctx_cs(appctx), ctx->peer, ctx->flags)) + if (!peers_dump_peer(&trash, appctx_sc(appctx), ctx->peer, ctx->flags)) goto out; ctx->peer = ctx->peer->next; diff --git a/src/proxy.c b/src/proxy.c index 02fc3ca4fe..3dc1d2429e 100644 --- a/src/proxy.c +++ b/src/proxy.c @@ -2786,7 +2786,7 @@ static int dump_servers_state(struct stconn *sc) static int cli_io_handler_servers_state(struct appctx *appctx) { struct show_srv_ctx *ctx = appctx->svcctx; - struct stconn *sc = appctx_cs(appctx); + struct stconn *sc = appctx_sc(appctx); struct proxy *curproxy; if (ctx->state == SHOW_SRV_HEAD) { @@ -3138,7 +3138,7 @@ static int cli_parse_show_errors(char **args, char *payload, struct appctx *appc static int cli_io_handler_show_errors(struct appctx *appctx) { struct show_errors_ctx *ctx = appctx->svcctx; - struct stconn *sc = appctx_cs(appctx); + struct stconn *sc = appctx_sc(appctx); extern const char *monthname[12]; if (unlikely(sc_ic(sc)->flags & (CF_WRITE_ERROR|CF_SHUTW))) diff --git a/src/ring.c b/src/ring.c index 3c3dcddec9..7c36f7bef4 100644 --- a/src/ring.c +++ b/src/ring.c @@ -290,7 +290,7 @@ int ring_attach_cli(struct ring *ring, struct appctx *appctx, uint flags) int cli_io_handler_show_ring(struct appctx *appctx) { struct show_ring_ctx *ctx = appctx->svcctx; - struct stconn *sc = appctx_cs(appctx); + struct stconn *sc = appctx_sc(appctx); struct ring *ring = ctx->ring; struct buffer *buf = &ring->buf; size_t ofs = ctx->ofs; diff --git a/src/sink.c b/src/sink.c index fff70e9c9a..0891bb34bd 100644 --- a/src/sink.c +++ b/src/sink.c @@ -299,7 +299,7 @@ void sink_setup_proxy(struct proxy *px) */ static void sink_forward_io_handler(struct appctx *appctx) { - struct stconn *sc = appctx_cs(appctx); + struct stconn *sc = appctx_sc(appctx); struct stream *s = __sc_strm(sc); struct sink *sink = strm_fe(s)->parent; struct sink_forward_target *sft = appctx->svcctx; @@ -438,7 +438,7 @@ static void sink_forward_io_handler(struct appctx *appctx) */ static void sink_forward_oc_io_handler(struct appctx *appctx) { - struct stconn *sc = appctx_cs(appctx); + struct stconn *sc = appctx_sc(appctx); struct stream *s = __sc_strm(sc); struct sink *sink = strm_fe(s)->parent; struct sink_forward_target *sft = appctx->svcctx; diff --git a/src/ssl_ckch.c b/src/ssl_ckch.c index 3ac7ae5147..f574fc46af 100644 --- a/src/ssl_ckch.c +++ b/src/ssl_ckch.c @@ -2044,7 +2044,7 @@ void ckch_store_replace(struct ckch_store *old_ckchs, struct ckch_store *new_ckc static int cli_io_handler_commit_cert(struct appctx *appctx) { struct commit_cert_ctx *ctx = appctx->svcctx; - struct stconn *sc = appctx_cs(appctx); + struct stconn *sc = appctx_sc(appctx); int y = 0; char *err = NULL; struct ckch_store *old_ckchs, *new_ckchs = NULL; @@ -2785,7 +2785,7 @@ static inline int __create_new_instance(struct appctx *appctx, struct ckch_inst static int cli_io_handler_commit_cafile_crlfile(struct appctx *appctx) { struct commit_cacrlfile_ctx *ctx = appctx->svcctx; - struct stconn *sc = appctx_cs(appctx); + struct stconn *sc = appctx_sc(appctx); int y = 0; char *err = NULL; struct cafile_entry *old_cafile_entry = NULL, *new_cafile_entry = NULL; diff --git a/src/ssl_crtlist.c b/src/ssl_crtlist.c index ece79f553e..318606860b 100644 --- a/src/ssl_crtlist.c +++ b/src/ssl_crtlist.c @@ -1063,7 +1063,7 @@ static int cli_io_handler_add_crtlist(struct appctx *appctx) { struct add_crtlist_ctx *ctx = appctx->svcctx; struct bind_conf_list *bind_conf_node; - struct stconn *sc = appctx_cs(appctx); + struct stconn *sc = appctx_sc(appctx); struct crtlist *crtlist = ctx->crtlist; struct crtlist_entry *entry = ctx->entry; struct ckch_store *store = entry->node.key; diff --git a/src/stats.c b/src/stats.c index 7f45dee7e6..dc9b040ffa 100644 --- a/src/stats.c +++ b/src/stats.c @@ -4283,7 +4283,7 @@ static int stats_send_http_redirect(struct stconn *sc, struct htx *htx) static void http_stats_io_handler(struct appctx *appctx) { struct show_stat_ctx *ctx = appctx->svcctx; - struct stconn *sc = appctx_cs(appctx); + struct stconn *sc = appctx_sc(appctx); struct stream *s = __sc_strm(sc); struct channel *req = sc_oc(sc); struct channel *res = sc_ic(sc); @@ -5000,7 +5000,7 @@ static int cli_parse_show_stat(char **args, char *payload, struct appctx *appctx static int cli_io_handler_dump_info(struct appctx *appctx) { - return stats_dump_info_to_buffer(appctx_cs(appctx)); + return stats_dump_info_to_buffer(appctx_sc(appctx)); } /* This I/O handler runs as an applet embedded in a stream connector. It is @@ -5008,7 +5008,7 @@ static int cli_io_handler_dump_info(struct appctx *appctx) */ static int cli_io_handler_dump_stat(struct appctx *appctx) { - return stats_dump_stat_to_buffer(appctx_cs(appctx), NULL, NULL); + return stats_dump_stat_to_buffer(appctx_sc(appctx), NULL, NULL); } static int cli_io_handler_dump_json_schema(struct appctx *appctx) diff --git a/src/stick_table.c b/src/stick_table.c index 3e1f3a535e..9112996aa5 100644 --- a/src/stick_table.c +++ b/src/stick_table.c @@ -4242,7 +4242,7 @@ static int table_dump_head_to_buffer(struct buffer *msg, struct appctx *appctx, struct stktable *t, struct stktable *target) { - struct stream *s = __sc_strm(appctx_cs(appctx)); + struct stream *s = __sc_strm(appctx_sc(appctx)); chunk_appendf(msg, "# table: %s, type: %s, size:%d, used:%d\n", t->id, stktable_types[t->type].kw, t->size, t->current); @@ -4663,7 +4663,7 @@ static int cli_parse_table_req(char **args, char *payload, struct appctx *appctx static int cli_io_handler_table(struct appctx *appctx) { struct show_table_ctx *ctx = appctx->svcctx; - struct stconn *sc = appctx_cs(appctx); + struct stconn *sc = appctx_sc(appctx); struct stream *s = __sc_strm(sc); struct ebmb_node *eb; int skip_entry; diff --git a/src/stream.c b/src/stream.c index 8b513d4d1f..127a5ab72c 100644 --- a/src/stream.c +++ b/src/stream.c @@ -3524,7 +3524,7 @@ static int cli_parse_show_sess(char **args, char *payload, struct appctx *appctx static int cli_io_handler_dump_sess(struct appctx *appctx) { struct show_sess_ctx *ctx = appctx->svcctx; - struct stconn *sc = appctx_cs(appctx); + struct stconn *sc = appctx_sc(appctx); struct connection *conn; thread_isolate();