]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: applet: rename appctx_cs() to appctx_sc()
authorWilly Tarreau <w@1wt.eu>
Fri, 27 May 2022 09:08:15 +0000 (11:08 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 27 May 2022 17:33:35 +0000 (19:33 +0200)
It returns a stream connector, not a conn_stream anymore, so let's
fix its name.

23 files changed:
addons/promex/service-prometheus.c
include/haproxy/applet.h
src/activity.c
src/applet.c
src/cache.c
src/cli.c
src/debug.c
src/dns.c
src/flt_spoe.c
src/hlua.c
src/http_client.c
src/log.c
src/map.c
src/mworker.c
src/peers.c
src/proxy.c
src/ring.c
src/sink.c
src/ssl_ckch.c
src/ssl_crtlist.c
src/stats.c
src/stick_table.c
src/stream.c

index 5e9cca23a4505a6f68ec0db8ba72f224e4f2f829..d27aefaaaa276a8d9c5ef4135b284ead69bc8af0 100644 (file)
@@ -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);
index 776a4015a33191465bf5ce20a5a91bbf4b3f3d83..01835d7d2970dd9beec9402c34e88fdbc5da476a 100644 (file)
@@ -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;
 }
index 4d55f914ff0ac7265a2255fe946f7b371fc8c691..10ee65dc211b15e5218e3e2b75f155401ddb16a2 100644 (file)
@@ -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;
index 7ec026e54c077e3c02ebdda6bd057dea559ba9a1..2b015a01abc8c1e0972e1a0c2333e8c1cf9bee95 100644 (file)
@@ -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
index 98c2ecefe8e284c84a6d46a7f0acab2ff3291c88..604d98d20fd0c642bc0ff3ddacce337855059e52 100644 (file)
@@ -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;
index 242ad7acd5ce84cc710939f5ba2b221680439e0f..5cb34cbf43687c8512fb264d3131059482534b7c 100644 (file)
--- 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;
index 72b6720789bd26645d2be4380b78f75a548d0a52..9a5c2946bc09f648543c8082804dbd9d3c994156 100644 (file)
@@ -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;
 
index 1a283bf30e5c6fdf37b4b661519940fedffaa3de..710cd5cb52c78bc244f320ab0aa4c21b195a3b14 100644 (file)
--- a/src/dns.c
+++ b/src/dns.c
@@ -438,7 +438,7 @@ out:
  */
 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;
index 9c92451660b3838e555d2279914c965ebcda4105..9973123f54cea258e44e888e3c96b7bf41187e80 100644 (file)
@@ -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)
index 375b034dc4d463321329e8a3b48b21575b42b2f5..c2f0382830ca0d41c92f1c349915902611509dce 100644 (file)
@@ -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. */
index f1b54889311a305b8285b26c978808d5cb816b61..61cd3a08c4e33371546f0b09607828bac55a4dfd 100644 (file)
@@ -195,7 +195,7 @@ err:
 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 @@ err:
 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;
index c6dbc5e21773d26606a29bc1e4dc0fdec9586d87..e25d2e79df480d49564555c0b584f28a6b3935f8 100644 (file)
--- a/src/log.c
+++ b/src/log.c
@@ -3559,7 +3559,7 @@ out:
 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);
index 8308a7a4fdb716ffab963cb01ec89faf56c58195..52ddb5c7fcf128949f00d197357b3367d3dc1e2c 100644 (file)
--- 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))) {
index e0a5df09af68a7af43c24f4f7b411c322fb88032..6a4fce48c215856339acfcee77b1363aedc44e12 100644 (file)
@@ -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;
index 6718034f1e7ea63664c19a576c1e788d16637daf..da83a799960927c9c48ded2c703597c68fdab82e 100644 (file)
@@ -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;
index 02fc3ca4fe1170bf2278f89c36c687116549b34c..3dc1d2429ecc7310016e088a501c8fb567b2a939 100644 (file)
@@ -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)))
index 3c3dcddec94f76028acffca89b53a78b0d0ad6d4..7c36f7bef49c68bf0bbc0539fa548aa650cf7c5e 100644 (file)
@@ -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;
index fff70e9c9ace46c0e3eb9122a73aa26681906851..0891bb34bd6226cb8b6f09224f036581b4e017c6 100644 (file)
@@ -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 @@ close:
  */
 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;
index 3ac7ae5147c9aa2222c7596719cdf975f4106dec..f574fc46afb46467431ce60ec2e44032fcd7138e 100644 (file)
@@ -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;
index ece79f553eecaa4728005b0005ad28ca70cd958c..318606860b48c10712e70f5006ef4d3b40bb06b2 100644 (file)
@@ -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;
index 7f45dee7e60fca92e342d4199f514e9b94aae648..dc9b040ffa39da9050ada58bdfa93c0d47c9499a 100644 (file)
@@ -4283,7 +4283,7 @@ full:
 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)
index 3e1f3a535eab391d9c4924b8954c450f773a059f..9112996aa545958e9623636349bb4bba24585b43 100644 (file)
@@ -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 @@ err_args:
 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;
index 8b513d4d1faacbdca8b64d87ac1950433a19c5eb..127a5ab72cdfe8d97603eeede3bad614ca8fe6a9 100644 (file)
@@ -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();