]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MEDIUM: applet: Set the conn-stream as appctx owner instead of the stream-int
authorChristopher Faulet <cfaulet@haproxy.com>
Mon, 20 Dec 2021 16:09:39 +0000 (17:09 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 24 Feb 2022 10:00:02 +0000 (11:00 +0100)
Because appctx is now an endpoint of the conn-stream, there is no reason to
still have the stream-interface as appctx owner. Thus, the conn-stream is
now the appctx owner.

28 files changed:
addons/promex/service-prometheus.c
include/haproxy/applet-t.h
include/haproxy/conn_stream.h
include/haproxy/stream_interface.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/pool.c
src/proxy.c
src/resolvers.c
src/ring.c
src/server.c
src/ssl_ckch.c
src/ssl_crtlist.c
src/ssl_sock.c
src/stats.c
src/stick_table.c
src/stream.c

index ef217007d28693c0be7d93144dcfaeb39516a512..5158d3233c56ccf33d30aeb63a7d832fe199cf06 100644 (file)
@@ -543,7 +543,7 @@ static int promex_dump_global_metrics(struct appctx *appctx, struct htx *htx)
 {
        static struct ist prefix = IST("haproxy_process_");
        struct field val;
-       struct channel *chn = si_ic(appctx->owner);
+       struct channel *chn = si_ic(cs_si(appctx->owner));
        struct ist out = ist2(trash.area, 0);
        size_t max = htx_get_max_blksz(htx, channel_htx_recv_max(chn, htx));
        int ret = 1;
@@ -594,7 +594,7 @@ static int promex_dump_front_metrics(struct appctx *appctx, struct htx *htx)
        static struct ist prefix = IST("haproxy_frontend_");
        struct proxy *px;
        struct field val;
-       struct channel *chn = si_ic(appctx->owner);
+       struct channel *chn = si_ic(cs_si(appctx->owner));
        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];
@@ -694,7 +694,7 @@ static int promex_dump_listener_metrics(struct appctx *appctx, struct htx *htx)
        static struct ist prefix = IST("haproxy_listener_");
        struct proxy *px;
        struct field val;
-       struct channel *chn = si_ic(appctx->owner);
+       struct channel *chn = si_ic(cs_si(appctx->owner));
        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];
@@ -785,7 +785,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 = si_ic(appctx->owner);
+       struct channel *chn = si_ic(cs_si(appctx->owner));
        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];
@@ -938,7 +938,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 = si_ic(appctx->owner);
+       struct channel *chn = si_ic(cs_si(appctx->owner));
        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];
@@ -1107,7 +1107,7 @@ static int promex_dump_sticktable_metrics(struct appctx *appctx, struct htx *htx
 {
        static struct ist prefix = IST("haproxy_sticktable_");
        struct field val;
-       struct channel *chn = si_ic(appctx->owner);
+       struct channel *chn = si_ic(cs_si(appctx->owner));
        struct ist out = ist2(trash.area, 0);
        size_t max = htx_get_max_blksz(htx, channel_htx_recv_max(chn, htx));
        int ret = 1;
@@ -1427,7 +1427,7 @@ static int promex_parse_uri(struct appctx *appctx, struct stream_interface *si)
  * full. */
 static int promex_send_headers(struct appctx *appctx, struct stream_interface *si, struct htx *htx)
 {
-       struct channel *chn = si_ic(appctx->owner);
+       struct channel *chn = si_ic(cs_si(appctx->owner));
        struct htx_sl *sl;
        unsigned int flags;
 
@@ -1463,7 +1463,7 @@ static int promex_appctx_init(struct appctx *appctx, struct proxy *px, struct st
 /* The main I/O handler for the promex applet. */
 static void promex_appctx_handle_io(struct appctx *appctx)
 {
-       struct stream_interface *si = appctx->owner;
+       struct stream_interface *si = cs_si(appctx->owner);
        struct stream *s = si_strm(si);
        struct channel *req = si_oc(si);
        struct channel *res = si_ic(si);
index faa399ed5de609e30dfebabed9fc52be3ecb9bc9..da8dfc87d8cd6408c0338bb7efd89822df15a3ac 100644 (file)
@@ -58,7 +58,7 @@ struct appctx {
        struct buffer *chunk;       /* used to store unfinished commands */
        unsigned int st2;          /* output state for stats, unused by peers  */
        struct applet *applet;     /* applet this context refers to */
-       void *owner;               /* pointer to upper layer's entity (eg: stream interface) */
+       void *owner;               /* pointer to upper layer's entity (eg: conn_stream) */
        struct act_rule *rule;     /* rule associated with the applet. */
        int (*io_handler)(struct appctx *appctx);  /* used within the cli_io_handler when st0 = CLI_ST_CALLBACK */
        void (*io_release)(struct appctx *appctx);  /* used within the cli_io_handler when st0 = CLI_ST_CALLBACK,
index 723265a596390bdac11de14fcde579faef997dfd..c7f736d2e42036cbbd6abb86a115012ba71ab626 100644 (file)
@@ -86,6 +86,11 @@ static inline struct appctx *cs_appctx(const struct conn_stream *cs)
        return (cs ? objt_appctx(cs->end) : NULL);
 }
 
+static inline struct stream_interface *cs_si(const struct conn_stream *cs)
+{
+       return ((cs_conn(cs) || cs_appctx(cs)) ? cs->data : NULL);
+}
+
 /* Attaches a conn_stream to a data layer and sets the relevant callbacks */
 static inline void cs_attach(struct conn_stream *cs, void *data, const struct data_cb *data_cb)
 {
index 81089660d5cfbba0b3a3f23869f6396d2e37d41b..314f54c5a042b6e078ff94e3f12046d798c8f0ce 100644 (file)
@@ -193,7 +193,7 @@ static inline void si_attach_cs(struct stream_interface *si, struct conn_stream
                struct appctx *appctx = cs_appctx(cs);
 
                si->ops = &si_applet_ops;
-               appctx->owner = si;
+               appctx->owner = cs;
                cs_attach(cs, si, NULL);
        }
        else {
@@ -221,7 +221,7 @@ static inline void si_attach_appctx(struct stream_interface *si, struct appctx *
 {
        si_reset_endpoint(si);
        cs_init(si->cs, &appctx->obj_type);
-       appctx->owner = si;
+       appctx->owner = si->cs;
        si_attach_cs(si, si->cs);
 }
 
index aab0b3c2b93d538e3e2b3b24232eb60203d8c103..7386247d9cca8b2593969ac57113c8a5e1be3bb8 100644 (file)
@@ -610,7 +610,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 stream_interface *si = appctx->owner;
+       struct stream_interface *si = cs_si(appctx->owner);
        struct buffer *name_buffer = get_trash_chunk();
        const char *str;
        int max_lines;
@@ -837,7 +837,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 stream_interface *si = appctx->owner;
+       struct stream_interface *si = cs_si(appctx->owner);
        struct buffer *name_buffer = get_trash_chunk();
        struct sched_activity *entry;
        const struct tasklet *tl;
index 7d1ec289b00da03740224501355480585e823d64..ff7381da2d3973aef19703aa6885d520df4ffd5c 100644 (file)
@@ -35,7 +35,7 @@ DECLARE_POOL(pool_head_appctx,  "appctx",  sizeof(struct appctx));
 int appctx_buf_available(void *arg)
 {
        struct appctx *appctx = arg;
-       struct stream_interface *si = appctx->owner;
+       struct stream_interface *si = cs_si(appctx->owner);
 
        /* allocation requested ? */
        if (!(si->flags & SI_FL_RXBLK_BUFF))
@@ -61,7 +61,7 @@ int appctx_buf_available(void *arg)
 struct task *task_run_applet(struct task *t, void *context, unsigned int state)
 {
        struct appctx *app = context;
-       struct stream_interface *si = app->owner;
+       struct stream_interface *si;
        unsigned int rate;
        size_t count;
 
@@ -70,6 +70,8 @@ struct task *task_run_applet(struct task *t, void *context, unsigned int state)
                return NULL;
        }
 
+       si = cs_si(app->owner);
+
        /* 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
         * that one applet which ignores any event will not spin.
@@ -112,4 +114,3 @@ struct task *task_run_applet(struct task *t, void *context, unsigned int state)
        channel_release_buffer(si_ic(si), &app->buffer_wait);
        return t;
 }
-
index d73696912e0713590efe61b753d424db40f8bad1..ac4c6827f1ecf3b9e544b7af8bf7b1d57aaa7b7a 100644 (file)
@@ -1272,7 +1272,7 @@ static unsigned int htx_cache_dump_blk(struct appctx *appctx, struct htx *htx, e
        unsigned int max, total;
        uint32_t blksz;
 
-       max = htx_get_max_blksz(htx, channel_htx_recv_max(si_ic(appctx->owner), htx));
+       max = htx_get_max_blksz(htx, channel_htx_recv_max(si_ic(cs_si(appctx->owner)), htx));
        if (!max)
                return 0;
        blksz = ((type == HTX_BLK_HDR || type == HTX_BLK_TLR)
@@ -1315,7 +1315,7 @@ static unsigned int htx_cache_dump_data_blk(struct appctx *appctx, struct htx *h
        unsigned int max, total, rem_data;
        uint32_t blksz;
 
-       max = htx_get_max_blksz(htx, channel_htx_recv_max(si_ic(appctx->owner), htx));
+       max = htx_get_max_blksz(htx, channel_htx_recv_max(si_ic(cs_si(appctx->owner)), htx));
        if (!max)
                return 0;
 
@@ -1429,7 +1429,7 @@ static void http_cache_io_handler(struct appctx *appctx)
 {
        struct cache_entry *cache_ptr = appctx->ctx.cache.entry;
        struct shared_block *first = block_ptr(cache_ptr);
-       struct stream_interface *si = appctx->owner;
+       struct stream_interface *si = cs_si(appctx->owner);
        struct channel *req = si_oc(si);
        struct channel *res = si_ic(si);
        struct htx *req_htx, *res_htx;
@@ -2563,7 +2563,7 @@ static int cli_parse_show_cache(char **args, char *payload, struct appctx *appct
 static int cli_io_handler_show_cache(struct appctx *appctx)
 {
        struct cache* cache = appctx->ctx.cli.p0;
-       struct stream_interface *si = appctx->owner;
+       struct stream_interface *si = cs_si(appctx->owner);
 
        if (cache == NULL) {
                cache = LIST_ELEM((caches).n, typeof(struct cache *), list);
index c8891129e7916b4642d42dcda5a4accbe1f80f78..b3a5fffb6ee037b675a6ddb750ca6506808106ab 100644 (file)
--- a/src/cli.c
+++ b/src/cli.c
@@ -669,7 +669,7 @@ static int cli_get_severity_output(struct appctx *appctx)
 {
        if (appctx->cli_severity_output)
                return appctx->cli_severity_output;
-       return strm_li(si_strm(appctx->owner))->bind_conf->severity_output;
+       return strm_li(si_strm(cs_si(appctx->owner)))->bind_conf->severity_output;
 }
 
 /* Processes the CLI interpreter on the stats socket. This function is called
@@ -837,7 +837,7 @@ static int cli_output_msg(struct channel *chn, const char *msg, int severity, in
  */
 static void cli_io_handler(struct appctx *appctx)
 {
-       struct stream_interface *si = appctx->owner;
+       struct stream_interface *si = cs_si(appctx->owner);
        struct channel *req = si_oc(si);
        struct channel *res = si_ic(si);
        struct bind_conf *bind_conf = strm_li(si_strm(si))->bind_conf;
@@ -1160,7 +1160,7 @@ static void cli_release_handler(struct appctx *appctx)
  */
 static int cli_io_handler_show_env(struct appctx *appctx)
 {
-       struct stream_interface *si = appctx->owner;
+       struct stream_interface *si = cs_si(appctx->owner);
        char **var = appctx->ctx.cli.p0;
 
        if (unlikely(si_ic(si)->flags & (CF_WRITE_ERROR|CF_SHUTW)))
@@ -1195,7 +1195,7 @@ static int cli_io_handler_show_env(struct appctx *appctx)
  */
 static int cli_io_handler_show_fd(struct appctx *appctx)
 {
-       struct stream_interface *si = appctx->owner;
+       struct stream_interface *si = cs_si(appctx->owner);
        int fd = appctx->ctx.cli.i0;
        int ret = 1;
 
@@ -1394,7 +1394,7 @@ static int cli_io_handler_show_fd(struct appctx *appctx)
  */
 static int cli_io_handler_show_activity(struct appctx *appctx)
 {
-       struct stream_interface *si = appctx->owner;
+       struct stream_interface *si = cs_si(appctx->owner);
        int thr;
 
        if (unlikely(si_ic(si)->flags & (CF_WRITE_ERROR|CF_SHUTW)))
@@ -1497,7 +1497,7 @@ static int cli_io_handler_show_activity(struct appctx *appctx)
 static int cli_io_handler_show_cli_sock(struct appctx *appctx)
 {
        struct bind_conf *bind_conf;
-       struct stream_interface *si = appctx->owner;
+       struct stream_interface *si = cs_si(appctx->owner);
 
        chunk_reset(&trash);
 
@@ -1634,7 +1634,7 @@ static int cli_parse_show_fd(char **args, char *payload, struct appctx *appctx,
 /* parse a "set timeout" CLI request. It always returns 1. */
 static int cli_parse_set_timeout(char **args, char *payload, struct appctx *appctx, void *private)
 {
-       struct stream_interface *si = appctx->owner;
+       struct stream_interface *si = cs_si(appctx->owner);
        struct stream *s = si_strm(si);
 
        if (strcmp(args[2], "cli") == 0) {
@@ -1918,7 +1918,7 @@ static int _getsocks(char **args, char *payload, struct appctx *appctx, void *pr
        char *cmsgbuf = NULL;
        unsigned char *tmpbuf = NULL;
        struct cmsghdr *cmsg;
-       struct stream_interface *si = appctx->owner;
+       struct stream_interface *si = cs_si(appctx->owner);
        struct stream *s = si_strm(si);
        struct connection *remote = cs_conn(si_opposite(si)->cs);
        struct msghdr msghdr;
index 1a69697e7f7fe5e7721a2c1c52df54a630e02e8a..0d4a3f3038bead8a2f5db28887b80be0cc27a886 100644 (file)
@@ -249,7 +249,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 = si_strm(((struct appctx *)task->context)->owner);
+               s = si_strm(cs_si(((struct appctx *)task->context)->owner));
        else if (task->process == si_cs_io_cb && task->context)
                s = si_strm((struct stream_interface *)task->context);
 
@@ -288,7 +288,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 stream_interface *si = appctx->owner;
+       struct stream_interface *si = cs_si(appctx->owner);
        int thr;
 
        if (unlikely(si_ic(si)->flags & (CF_WRITE_ERROR|CF_SHUTW)))
@@ -632,7 +632,7 @@ static int debug_parse_cli_write(char **args, char *payload, struct appctx *appc
  */
 static int debug_parse_cli_stream(char **args, char *payload, struct appctx *appctx, void *private)
 {
-       struct stream *s = si_strm(appctx->owner);
+       struct stream *s = si_strm(cs_si(appctx->owner));
        int arg;
        void *ptr;
        int size;
@@ -1182,7 +1182,7 @@ static int debug_parse_cli_memstats(char **args, char *payload, struct appctx *a
  */
 static int debug_iohandler_memstats(struct appctx *appctx)
 {
-       struct stream_interface *si = appctx->owner;
+       struct stream_interface *si = cs_si(appctx->owner);
        struct mem_stats *ptr = appctx->ctx.cli.p0;
        int ret = 1;
 
index 2caa5ad27bd2c1d99d318045c4cc91bb9c234579..719aed6f0a88027fa18c681f154305abed5c3209 100644 (file)
--- a/src/dns.c
+++ b/src/dns.c
@@ -407,7 +407,7 @@ out:
  */
 static void dns_session_io_handler(struct appctx *appctx)
 {
-       struct stream_interface *si = appctx->owner;
+       struct stream_interface *si = cs_si(appctx->owner);
        struct dns_session *ds = appctx->ctx.sft.ptr;
        struct ring *ring = &ds->ring;
        struct buffer *buf = &ring->buf;
index 8b2de432c61e281d44ba63b2eead4ef647970109..a12d75daabcfde3b8c9dd49ce7da13a39d111e5f 100644 (file)
@@ -1135,7 +1135,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 stream_interface *si = appctx->owner;
+       struct stream_interface *si = cs_si(appctx->owner);
        int      ret;
        uint32_t netint;
 
@@ -1161,7 +1161,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 stream_interface *si = appctx->owner;
+       struct stream_interface *si = cs_si(appctx->owner);
        int      ret;
        uint32_t netint;
 
@@ -1190,8 +1190,8 @@ spoe_recv_frame(struct appctx *appctx, char *buf, size_t framesz)
 static int
 spoe_wakeup_appctx(struct appctx *appctx)
 {
-       si_want_get(appctx->owner);
-       si_rx_endp_more(appctx->owner);
+       si_want_get(cs_si(appctx->owner));
+       si_rx_endp_more(cs_si(appctx->owner));
        appctx_wakeup(appctx);
        return 1;
 }
@@ -1217,7 +1217,7 @@ spoe_process_appctx(struct task * task, void *context, unsigned int state)
 static void
 spoe_release_appctx(struct appctx *appctx)
 {
-       struct stream_interface *si          = appctx->owner;
+       struct stream_interface *si          = cs_si(appctx->owner);
        struct spoe_appctx      *spoe_appctx = SPOE_APPCTX(appctx);
        struct spoe_agent       *agent;
        struct spoe_context     *ctx, *back;
@@ -1337,7 +1337,7 @@ spoe_release_appctx(struct appctx *appctx)
 static int
 spoe_handle_connect_appctx(struct appctx *appctx)
 {
-       struct stream_interface *si    = appctx->owner;
+       struct stream_interface *si    = cs_si(appctx->owner);
        struct spoe_agent       *agent = SPOE_APPCTX(appctx)->agent;
        char *frame, *buf;
        int   ret;
@@ -1403,7 +1403,7 @@ spoe_handle_connect_appctx(struct appctx *appctx)
 static int
 spoe_handle_connecting_appctx(struct appctx *appctx)
 {
-       struct stream_interface *si     = appctx->owner;
+       struct stream_interface *si     = cs_si(appctx->owner);
        struct spoe_agent       *agent  = SPOE_APPCTX(appctx)->agent;
        char  *frame;
        int    ret;
@@ -1648,7 +1648,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(si_oc(appctx->owner), trash.data);
+               co_skip(si_oc(cs_si(appctx->owner)), trash.data);
   end:
        return ret;
 }
@@ -1656,7 +1656,7 @@ spoe_handle_receiving_frame_appctx(struct appctx *appctx, int *skip)
 static int
 spoe_handle_processing_appctx(struct appctx *appctx)
 {
-       struct stream_interface *si    = appctx->owner;
+       struct stream_interface *si    = cs_si(appctx->owner);
        struct server           *srv   = objt_server(si_strm(si)->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;
@@ -1779,7 +1779,7 @@ spoe_handle_processing_appctx(struct appctx *appctx)
 static int
 spoe_handle_disconnect_appctx(struct appctx *appctx)
 {
-       struct stream_interface *si    = appctx->owner;
+       struct stream_interface *si    = cs_si(appctx->owner);
        struct spoe_agent       *agent = SPOE_APPCTX(appctx)->agent;
        char *frame, *buf;
        int   ret;
@@ -1832,7 +1832,7 @@ spoe_handle_disconnect_appctx(struct appctx *appctx)
 static int
 spoe_handle_disconnecting_appctx(struct appctx *appctx)
 {
-       struct stream_interface *si = appctx->owner;
+       struct stream_interface *si = cs_si(appctx->owner);
        char  *frame;
        int    ret;
 
@@ -1883,7 +1883,7 @@ spoe_handle_disconnecting_appctx(struct appctx *appctx)
   next:
        /* Do not forget to remove processed frame from the output buffer */
        if (trash.data)
-               co_skip(si_oc(appctx->owner), trash.data);
+               co_skip(si_oc(cs_si(appctx->owner)), trash.data);
 
        return 0;
   stop:
@@ -1897,7 +1897,7 @@ spoe_handle_disconnecting_appctx(struct appctx *appctx)
 static void
 spoe_handle_appctx(struct appctx *appctx)
 {
-       struct stream_interface *si = appctx->owner;
+       struct stream_interface *si = cs_si(appctx->owner);
        struct spoe_agent       *agent;
 
        if (SPOE_APPCTX(appctx) == NULL)
index c61e6666789df59b6f8dbd59847b63671a4638d1..35ed2e5bb6a1dc77b98e330db3c328f696a6455b 100644 (file)
@@ -1905,7 +1905,7 @@ __LJMP static struct hlua_socket *hlua_checksocket(lua_State *L, int ud)
  */
 static void hlua_socket_handler(struct appctx *appctx)
 {
-       struct stream_interface *si = appctx->owner;
+       struct stream_interface *si = cs_si(appctx->owner);
 
        if (appctx->ctx.hlua_cosocket.die) {
                si_shutw(si);
@@ -2101,7 +2101,7 @@ __LJMP static int hlua_socket_receive_yield(struct lua_State *L, int status, lua
        if (!peer)
                goto no_peer;
        appctx = container_of(peer, struct appctx, ctx.hlua_cosocket.xref);
-       si = appctx->owner;
+       si = cs_si(appctx->owner);
        s = si_strm(si);
 
        oc = &s->res;
@@ -2340,7 +2340,7 @@ static int hlua_socket_write_yield(struct lua_State *L,int status, lua_KContext
                return 1;
        }
        appctx = container_of(peer, struct appctx, ctx.hlua_cosocket.xref);
-       si = appctx->owner;
+       si = cs_si(appctx->owner);
        s = si_strm(si);
 
        /* Check for connection close. */
@@ -2573,7 +2573,7 @@ __LJMP static int hlua_socket_getpeername(struct lua_State *L)
                return 1;
        }
        appctx = container_of(peer, struct appctx, ctx.hlua_cosocket.xref);
-       si = appctx->owner;
+       si = cs_si(appctx->owner);
        dst = si_dst(si_opposite(si));
        if (!dst) {
                xref_unlock(&socket->xref, peer);
@@ -2614,7 +2614,7 @@ static int hlua_socket_getsockname(struct lua_State *L)
                return 1;
        }
        appctx = container_of(peer, struct appctx, ctx.hlua_cosocket.xref);
-       si = appctx->owner;
+       si = cs_si(appctx->owner);
        s = si_strm(si);
 
        conn = cs_conn(s->si[1].cs);
@@ -2665,7 +2665,7 @@ __LJMP static int hlua_socket_connect_yield(struct lua_State *L, int status, lua
                return 2;
        }
        appctx = container_of(peer, struct appctx, ctx.hlua_cosocket.xref);
-       si = appctx->owner;
+       si = cs_si(appctx->owner);
        s = si_strm(si);
 
        /* Check if we run on the same thread than the xreator thread.
@@ -2777,7 +2777,7 @@ __LJMP static int hlua_socket_connect(struct lua_State *L)
        }
 
        appctx = container_of(peer, struct appctx, ctx.hlua_cosocket.xref);
-       si = appctx->owner;
+       si = cs_si(appctx->owner);
        s = si_strm(si);
 
        if (!sockaddr_alloc(&si_opposite(si)->dst, addr, sizeof(*addr))) {
@@ -2833,7 +2833,7 @@ __LJMP static int hlua_socket_connect_ssl(struct lua_State *L)
                return 1;
        }
        appctx = container_of(peer, struct appctx, ctx.hlua_cosocket.xref);
-       si = appctx->owner;
+       si = cs_si(appctx->owner);
        s = si_strm(si);
 
        s->target = &socket_ssl->obj_type;
@@ -2889,7 +2889,7 @@ __LJMP static int hlua_socket_settimeout(struct lua_State *L)
                return 0;
        }
        appctx = container_of(peer, struct appctx, ctx.hlua_cosocket.xref);
-       si = appctx->owner;
+       si = cs_si(appctx->owner);
        s = si_strm(si);
 
        s->sess->fe->timeout.connect = tmout;
@@ -4269,7 +4269,7 @@ __LJMP static struct hlua_appctx *hlua_checkapplet_tcp(lua_State *L, int ud)
 static int hlua_applet_tcp_new(lua_State *L, struct appctx *ctx)
 {
        struct hlua_appctx *luactx;
-       struct stream_interface *si = ctx->owner;
+       struct stream_interface *si = cs_si(ctx->owner);
        struct stream *s = si_strm(si);
        struct proxy *p = s->be;
 
@@ -4450,7 +4450,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 stream_interface *si = luactx->appctx->owner;
+       struct stream_interface *si = cs_si(luactx->appctx->owner);
        int ret;
        const char *blk1;
        size_t len1;
@@ -4504,7 +4504,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 stream_interface *si = luactx->appctx->owner;
+       struct stream_interface *si = cs_si(luactx->appctx->owner);
        size_t len = MAY_LJMP(luaL_checkinteger(L, 2));
        int ret;
        const char *blk1;
@@ -4612,7 +4612,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 stream_interface *si = luactx->appctx->owner;
+       struct stream_interface *si = cs_si(luactx->appctx->owner);
        struct channel *chn = si_ic(si);
        int max;
 
@@ -4675,7 +4675,7 @@ static int hlua_applet_http_new(lua_State *L, struct appctx *ctx)
 {
        struct hlua_appctx *luactx;
        struct hlua_txn htxn;
-       struct stream_interface *si = ctx->owner;
+       struct stream_interface *si = cs_si(ctx->owner);
        struct stream *s = si_strm(si);
        struct proxy *px = s->be;
        struct htx *htx;
@@ -4937,7 +4937,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 stream_interface *si = luactx->appctx->owner;
+       struct stream_interface *si = cs_si(luactx->appctx->owner);
        struct channel *req = si_oc(si);
        struct htx *htx;
        struct htx_blk *blk;
@@ -5032,7 +5032,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 stream_interface *si = luactx->appctx->owner;
+       struct stream_interface *si = cs_si(luactx->appctx->owner);
        struct channel *req = si_oc(si);
        struct htx *htx;
        struct htx_blk *blk;
@@ -5141,7 +5141,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 stream_interface *si = luactx->appctx->owner;
+       struct stream_interface *si = cs_si(luactx->appctx->owner);
        struct channel *res = si_ic(si);
        struct htx *htx = htx_from_buf(&res->buf);
        const char *data;
@@ -5275,7 +5275,7 @@ __LJMP static int hlua_applet_http_status(lua_State *L)
 __LJMP static int hlua_applet_http_send_response(lua_State *L)
 {
        struct hlua_appctx *luactx = MAY_LJMP(hlua_checkapplet_http(L, 1));
-       struct stream_interface *si = luactx->appctx->owner;
+       struct stream_interface *si = cs_si(luactx->appctx->owner);
        struct channel *res = si_ic(si);
        struct htx *htx;
        struct htx_sl *sl;
@@ -5474,7 +5474,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 stream_interface *si = luactx->appctx->owner;
+       struct stream_interface *si = cs_si(luactx->appctx->owner);
        struct channel *res = si_ic(si);
 
        if (co_data(res)) {
@@ -9182,7 +9182,7 @@ struct task *hlua_applet_wakeup(struct task *t, void *context, unsigned int stat
 
 static int hlua_applet_tcp_init(struct appctx *ctx, struct proxy *px, struct stream *strm)
 {
-       struct stream_interface *si = ctx->owner;
+       struct stream_interface *si = cs_si(ctx->owner);
        struct hlua *hlua;
        struct task *task;
        char **arg;
@@ -9278,7 +9278,7 @@ static int hlua_applet_tcp_init(struct appctx *ctx, struct proxy *px, struct str
 
 void hlua_applet_tcp_fct(struct appctx *ctx)
 {
-       struct stream_interface *si = ctx->owner;
+       struct stream_interface *si = cs_si(ctx->owner);
        struct stream *strm = si_strm(si);
        struct channel *res = si_ic(si);
        struct act_rule *rule = ctx->rule;
@@ -9369,7 +9369,7 @@ static void hlua_applet_tcp_release(struct appctx *ctx)
  */
 static int hlua_applet_http_init(struct appctx *ctx, struct proxy *px, struct stream *strm)
 {
-       struct stream_interface *si = ctx->owner;
+       struct stream_interface *si = cs_si(ctx->owner);
        struct http_txn *txn;
        struct hlua *hlua;
        char **arg;
@@ -9470,7 +9470,7 @@ static int hlua_applet_http_init(struct appctx *ctx, struct proxy *px, struct st
 
 void hlua_applet_http_fct(struct appctx *ctx)
 {
-       struct stream_interface *si = ctx->owner;
+       struct stream_interface *si = cs_si(ctx->owner);
        struct stream *strm = si_strm(si);
        struct channel *req = si_oc(si);
        struct channel *res = si_ic(si);
@@ -10089,7 +10089,7 @@ static int hlua_cli_io_handler_fct(struct appctx *appctx)
        struct hlua_function *fcn;
 
        hlua = appctx->ctx.hlua_cli.hlua;
-       si = appctx->owner;
+       si = cs_si(appctx->owner);
        fcn = appctx->ctx.hlua_cli.fcn;
 
        /* If the stream is disconnect or closed, ldo nothing. */
index 64e5190bec7318bcc3a6b38791938790c1394ae0..0149eeb885b3e78754f3c2d5ee1a6617164737b2 100644 (file)
@@ -165,7 +165,7 @@ err:
  */
 static int hc_cli_io_handler(struct appctx *appctx)
 {
-       struct stream_interface *si = appctx->owner;
+       struct stream_interface *si = cs_si(appctx->owner);
        struct buffer *trash = alloc_trash_chunk();
        struct httpclient *hc = appctx->ctx.cli.p0;
        struct http_hdr *hdrs, *hdr;
@@ -639,7 +639,7 @@ err:
 static void httpclient_applet_io_handler(struct appctx *appctx)
 {
        struct httpclient *hc = appctx->ctx.httpclient.ptr;
-       struct stream_interface *si = appctx->owner;
+       struct stream_interface *si = cs_si(appctx->owner);
        struct stream *s = si_strm(si);
        struct channel *req = &s->req;
        struct channel *res = &s->res;
index 0213435c23fe398aa1a3f904b1ede8b296b554c8..dbcffc6b5120055846f153d4eecdbcd1db71e4a5 100644 (file)
--- a/src/log.c
+++ b/src/log.c
@@ -3550,7 +3550,7 @@ out:
 static void syslog_io_handler(struct appctx *appctx)
 {
        static THREAD_LOCAL struct ist metadata[LOG_META_FIELDS];
-       struct stream_interface *si = appctx->owner;
+       struct stream_interface *si = cs_si(appctx->owner);
        struct stream *s = si_strm(si);
        struct proxy *frontend = strm_fe(s);
        struct listener *l = strm_li(s);
index 00297022da064de64976a01e36ccd7ab376400b6..870d92410a2551905970f4b8a2d450001a561b51 100644 (file)
--- a/src/map.c
+++ b/src/map.c
@@ -323,7 +323,7 @@ struct pattern_expr *pat_expr_get_next(struct pattern_expr *getnext, struct list
 /* expects the current generation ID in appctx->cli.cli.i0 */
 static int cli_io_handler_pat_list(struct appctx *appctx)
 {
-       struct stream_interface *si = appctx->owner;
+       struct stream_interface *si = cs_si(appctx->owner);
        struct pat_ref_elt *elt;
 
        if (unlikely(si_ic(si)->flags & (CF_WRITE_ERROR|CF_SHUTW))) {
@@ -406,7 +406,7 @@ static int cli_io_handler_pat_list(struct appctx *appctx)
 
 static int cli_io_handler_pats_list(struct appctx *appctx)
 {
-       struct stream_interface *si = appctx->owner;
+       struct stream_interface *si = cs_si(appctx->owner);
 
        switch (appctx->st2) {
        case STAT_ST_INIT:
@@ -468,7 +468,7 @@ static int cli_io_handler_pats_list(struct appctx *appctx)
 
 static int cli_io_handler_map_lookup(struct appctx *appctx)
 {
-       struct stream_interface *si = appctx->owner;
+       struct stream_interface *si = cs_si(appctx->owner);
        struct sample sample;
        struct pattern *pat;
        int match_method;
@@ -993,7 +993,7 @@ static int cli_parse_del_map(char **args, char *payload, struct appctx *appctx,
  */
 static int cli_io_handler_clear_map(struct appctx *appctx)
 {
-       struct stream_interface *si = appctx->owner;
+       struct stream_interface *si = cs_si(appctx->owner);
        int finished;
 
        HA_SPIN_LOCK(PATREF_LOCK, &appctx->ctx.map.ref->lock);
index 5d30b18519bbbbce8c2ed01a462999d58a951ae3..e690f8b7da3f1ffa25cb21f89952194d22aaa6e1 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 stream_interface *si = appctx->owner;
+       struct stream_interface *si = cs_si(appctx->owner);
        struct mworker_proc *child;
        int old = 0;
        int up = now.tv_sec - proc_self->timestamp;
index df3fd9eb6c9026b4edb5844e075a18c16ff07cd4..1b8045273913f3554df9825b7c8862b781661ee8 100644 (file)
@@ -446,7 +446,7 @@ static void peers_trace(enum trace_level level, uint64_t mask,
                        if (peer->appctx) {
                                struct stream_interface *si;
 
-                               si = peer->appctx->owner;
+                               si = cs_si(peer->appctx->owner);
                                if (si) {
                                        struct stream *s = si_strm(si);
 
@@ -1049,7 +1049,7 @@ void __peer_session_deinit(struct peer *peer)
        if (!peer->appctx)
                return;
 
-       si = peer->appctx->owner;
+       si = cs_si(peer->appctx->owner);
        if (!si)
                return;
 
@@ -1149,7 +1149,7 @@ static int peer_get_version(const char *str,
 static inline int peer_getline(struct appctx  *appctx)
 {
        int n;
-       struct stream_interface *si = appctx->owner;
+       struct stream_interface *si = cs_si(appctx->owner);
 
        n = co_getline(si_oc(si), trash.area, trash.size);
        if (!n)
@@ -1182,7 +1182,7 @@ static inline int peer_send_msg(struct appctx *appctx,
                                 struct peer_prep_params *params)
 {
        int ret, msglen;
-       struct stream_interface *si = appctx->owner;
+       struct stream_interface *si = cs_si(appctx->owner);
 
        msglen = peer_prepare_msg(trash.area, trash.size, params);
        if (!msglen) {
@@ -1662,7 +1662,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 stream_interface *si = appctx->owner;
+       struct stream_interface *si = cs_si(appctx->owner);
        struct shared_table *st = p->remote_table;
        struct stksess *ts, *newts;
        uint32_t update;
@@ -2114,7 +2114,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 stream_interface *si = appctx->owner;
+       struct stream_interface *si = cs_si(appctx->owner);
        int table_id_len;
        struct shared_table *st;
        int table_type;
@@ -2313,7 +2313,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 stream_interface *si = appctx->owner;
+       struct stream_interface *si = cs_si(appctx->owner);
        char *cur;
 
        reql = co_getblk(si_oc(si), msg_head, 2 * sizeof(char), *totl);
@@ -2385,7 +2385,7 @@ static inline int peer_recv_msg(struct appctx *appctx, char *msg_head, size_t ms
 static inline int peer_treat_awaited_msg(struct appctx *appctx, struct peer *peer, unsigned char *msg_head,
                                          char **msg_cur, char *msg_end, int msg_len, int totl)
 {
-       struct stream_interface *si = appctx->owner;
+       struct stream_interface *si = cs_si(appctx->owner);
        struct stream *s = si_strm(si);
        struct peers *peers = strm_fe(s)->parent;
 
@@ -2673,7 +2673,7 @@ static inline int peer_getline_last(struct appctx *appctx, struct peer **curpeer
        char *p;
        int reql;
        struct peer *peer;
-       struct stream_interface *si = appctx->owner;
+       struct stream_interface *si = cs_si(appctx->owner);
        struct stream *s = si_strm(si);
        struct peers *peers = strm_fe(s)->parent;
 
@@ -2834,7 +2834,7 @@ static inline void init_connected_peer(struct peer *peer, struct peers *peers)
  */
 static void peer_io_handler(struct appctx *appctx)
 {
-       struct stream_interface *si = appctx->owner;
+       struct stream_interface *si = cs_si(appctx->owner);
        struct stream *s = si_strm(si);
        struct peers *curpeers = strm_fe(s)->parent;
        struct peer *curpeer = NULL;
@@ -3829,7 +3829,7 @@ static int peers_dump_peer(struct buffer *msg, struct stream_interface *si, stru
        chunk_appendf(&trash, " appctx:%p st0=%d st1=%d task_calls=%u", appctx, appctx->st0, appctx->st1,
                                                                        appctx->t ? appctx->t->calls : 0);
 
-       peer_si = peer->appctx->owner;
+       peer_si = cs_si(peer->appctx->owner);
        if (!peer_si)
                goto table_info;
 
@@ -3952,7 +3952,7 @@ static int cli_io_handler_show_peers(struct appctx *appctx)
 {
        int show_all;
        int ret = 0, first_peers = 1;
-       struct stream_interface *si = appctx->owner;
+       struct stream_interface *si = cs_si(appctx->owner);
 
        thread_isolate();
 
index 0e33cd353fa61dd3efdf4744fc989cf08f776b59..45c05fa454dd2fcf2bb8c4124665441428dc1f86 100644 (file)
@@ -995,7 +995,7 @@ int pool_parse_debugging(const char *str, char **err)
  */
 static int cli_io_handler_dump_pools(struct appctx *appctx)
 {
-       struct stream_interface *si = appctx->owner;
+       struct stream_interface *si = cs_si(appctx->owner);
 
        dump_pools_to_trash();
        if (ci_putchk(si_ic(si), &trash) == -1) {
index a97b3cd80e72f79039283d461f866856458f8db7..a130e00f897ea35a7bd7e8f20103b453a974f1b5 100644 (file)
@@ -2689,7 +2689,7 @@ static int dump_servers_state(struct stream_interface *si)
  */
 static int cli_io_handler_servers_state(struct appctx *appctx)
 {
-       struct stream_interface *si = appctx->owner;
+       struct stream_interface *si = cs_si(appctx->owner);
        struct proxy *curproxy;
 
        chunk_reset(&trash);
@@ -2736,7 +2736,7 @@ static int cli_io_handler_servers_state(struct appctx *appctx)
  */
 static int cli_io_handler_show_backend(struct appctx *appctx)
 {
-       struct stream_interface *si = appctx->owner;
+       struct stream_interface *si = cs_si(appctx->owner);
        struct proxy *curproxy;
 
        chunk_reset(&trash);
@@ -3039,7 +3039,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 stream_interface *si = appctx->owner;
+       struct stream_interface *si = cs_si(appctx->owner);
        extern const char *monthname[12];
 
        if (unlikely(si_ic(si)->flags & (CF_WRITE_ERROR|CF_SHUTW)))
index 43e755b2c98701e3ddc1ebe22a8735041c542355..dff09fe6e3c16f1660d97a6aafd7b8a9d97c9a4b 100644 (file)
@@ -2745,7 +2745,7 @@ static int cli_parse_stat_resolvers(char **args, char *payload, struct appctx *a
  */
 static int cli_io_handler_dump_resolvers_to_buffer(struct appctx *appctx)
 {
-       struct stream_interface *si = appctx->owner;
+       struct stream_interface *si = cs_si(appctx->owner);
        struct resolvers    *resolvers;
        struct dns_nameserver   *ns;
 
index 4f1bca270ede667a3b317427bc69a36561af7959..e5d4fb53c053482ebaeaaabaf91637e2e0720f68 100644 (file)
@@ -276,7 +276,7 @@ int ring_attach_cli(struct ring *ring, struct appctx *appctx)
  */
 int cli_io_handler_show_ring(struct appctx *appctx)
 {
-       struct stream_interface *si = appctx->owner;
+       struct stream_interface *si = cs_si(appctx->owner);
        struct ring *ring = appctx->ctx.cli.p0;
        struct buffer *buf = &ring->buf;
        size_t ofs = appctx->ctx.cli.o0;
index d165f50b936fbeeafdf3f411003acca011e93b64..6e1e2f1fe28cb12a7caf5dbc43dbd2070b33a415 100644 (file)
@@ -4314,7 +4314,7 @@ static int cli_parse_set_server(char **args, char *payload, struct appctx *appct
 
 static int cli_parse_get_weight(char **args, char *payload, struct appctx *appctx, void *private)
 {
-       struct stream_interface *si = appctx->owner;
+       struct stream_interface *si = cs_si(appctx->owner);
        struct proxy *px;
        struct server *sv;
        char *line;
index 24e31309436f39d3ba0dd81f402709ba26f15b6c..08472c68f18cc7df406e5f8b6d36228ad4d84c06 100644 (file)
@@ -1159,7 +1159,7 @@ static int cli_io_handler_show_cert(struct appctx *appctx)
 {
        struct buffer *trash = alloc_trash_chunk();
        struct ebmb_node *node;
-       struct stream_interface *si = appctx->owner;
+       struct stream_interface *si = cs_si(appctx->owner);
        struct ckch_store *ckchs;
 
        if (trash == NULL)
@@ -1558,7 +1558,7 @@ static int ckch_store_show_ocsp_certid(struct ckch_store *ckch_store, struct buf
 /* IO handler of the details "show ssl cert <filename>" */
 static int cli_io_handler_show_cert_detail(struct appctx *appctx)
 {
-       struct stream_interface *si = appctx->owner;
+       struct stream_interface *si = cs_si(appctx->owner);
        struct ckch_store *ckchs = appctx->ctx.cli.p0;
        struct buffer *out = alloc_trash_chunk();
        int retval = 0;
@@ -1606,7 +1606,7 @@ yield:
 static int cli_io_handler_show_cert_ocsp_detail(struct appctx *appctx)
 {
 #if ((defined SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB && !defined OPENSSL_NO_OCSP) && !defined OPENSSL_IS_BORINGSSL)
-       struct stream_interface *si = appctx->owner;
+       struct stream_interface *si = cs_si(appctx->owner);
        struct ckch_store *ckchs = appctx->ctx.cli.p0;
        struct buffer *out = alloc_trash_chunk();
        int from_transaction = appctx->ctx.cli.i0;
@@ -1837,7 +1837,7 @@ static void __ckch_inst_free_locked(struct ckch_inst *ckchi)
  */
 static int cli_io_handler_commit_cert(struct appctx *appctx)
 {
-       struct stream_interface *si = appctx->owner;
+       struct stream_interface *si = cs_si(appctx->owner);
        int y = 0;
        char *err = NULL;
        struct ckch_store *old_ckchs, *new_ckchs = NULL;
@@ -2603,7 +2603,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 stream_interface *si = appctx->owner;
+       struct stream_interface *si = cs_si(appctx->owner);
        int y = 0;
        char *err = NULL;
        struct cafile_entry *old_cafile_entry = NULL, *new_cafile_entry = NULL;
@@ -2827,7 +2827,7 @@ static void cli_release_commit_cafile(struct appctx *appctx)
 /* IO handler of details "show ssl ca-file <filename[:index]>" */
 static int cli_io_handler_show_cafile_detail(struct appctx *appctx)
 {
-       struct stream_interface *si = appctx->owner;
+       struct stream_interface *si = cs_si(appctx->owner);
        struct cafile_entry *cafile_entry = appctx->ctx.cli.p0;
        struct buffer *out = alloc_trash_chunk();
        int i;
@@ -2980,7 +2980,7 @@ static int cli_io_handler_show_cafile(struct appctx *appctx)
 {
        struct buffer *trash = alloc_trash_chunk();
        struct ebmb_node *node;
-       struct stream_interface *si = appctx->owner;
+       struct stream_interface *si = cs_si(appctx->owner);
        struct cafile_entry *cafile_entry;
 
        if (trash == NULL)
@@ -3486,7 +3486,7 @@ end:
 /* IO handler of details "show ssl crl-file <filename[:index]>" */
 static int cli_io_handler_show_crlfile_detail(struct appctx *appctx)
 {
-       struct stream_interface *si = appctx->owner;
+       struct stream_interface *si = cs_si(appctx->owner);
        struct cafile_entry *cafile_entry = appctx->ctx.cli.p0;
        struct buffer *out = alloc_trash_chunk();
        int i;
@@ -3616,7 +3616,7 @@ static int cli_io_handler_show_crlfile(struct appctx *appctx)
 {
        struct buffer *trash = alloc_trash_chunk();
        struct ebmb_node *node;
-       struct stream_interface *si = appctx->owner;
+       struct stream_interface *si = cs_si(appctx->owner);
        struct cafile_entry *cafile_entry;
 
        if (trash == NULL)
index 93168e3c7f7cb087cc2b360a6876770c91eea264..c1675fe822d51bbead3f995bb7b8833f7168b438 100644 (file)
@@ -887,7 +887,7 @@ static void dump_crtlist_filters(struct buffer *buf, struct crtlist_entry *entry
 static int cli_io_handler_dump_crtlist(struct appctx *appctx)
 {
        struct buffer *trash = alloc_trash_chunk();
-       struct stream_interface *si = appctx->owner;
+       struct stream_interface *si = cs_si(appctx->owner);
        struct ebmb_node *lnode;
 
        if (trash == NULL)
@@ -918,7 +918,7 @@ static int cli_io_handler_dump_crtlist_entries(struct appctx *appctx)
 {
        struct buffer *trash = alloc_trash_chunk();
        struct crtlist *crtlist;
-       struct stream_interface *si = appctx->owner;
+       struct stream_interface *si = cs_si(appctx->owner);
        struct crtlist_entry *entry;
 
        if (trash == NULL)
@@ -1041,7 +1041,7 @@ static void cli_release_add_crtlist(struct appctx *appctx)
 static int cli_io_handler_add_crtlist(struct appctx *appctx)
 {
        struct bind_conf_list *bind_conf_node;
-       struct stream_interface *si = appctx->owner;
+       struct stream_interface *si = cs_si(appctx->owner);
        struct crtlist *crtlist = appctx->ctx.cli.p0;
        struct crtlist_entry *entry = appctx->ctx.cli.p1;
        struct ckch_store *store = entry->node.key;
index b79fc71d41e2393c0284a4b3167db12b07a37b30..7f30b8f2038756b0ea760fe335f3a817430ef543 100644 (file)
@@ -7195,7 +7195,7 @@ static inline int cli_io_handler_tlskeys_entries(struct appctx *appctx) {
  */
 static int cli_io_handler_tlskeys_files(struct appctx *appctx) {
 
-       struct stream_interface *si = appctx->owner;
+       struct stream_interface *si = cs_si(appctx->owner);
 
        switch (appctx->st2) {
        case STAT_ST_INIT:
@@ -7471,7 +7471,7 @@ static int cli_io_handler_show_ocspresponse(struct appctx *appctx)
        struct buffer *trash = alloc_trash_chunk();
        struct buffer *tmp = NULL;
        struct ebmb_node *node;
-       struct stream_interface *si = appctx->owner;
+       struct stream_interface *si = cs_si(appctx->owner);
        struct certificate_ocsp *ocsp = NULL;
        BIO *bio = NULL;
        int write = -1;
@@ -7658,7 +7658,7 @@ static int cli_io_handler_show_ocspresponse_detail(struct appctx *appctx)
 {
        struct buffer *trash = alloc_trash_chunk();
        struct certificate_ocsp *ocsp = NULL;
-       struct stream_interface *si = appctx->owner;
+       struct stream_interface *si = cs_si(appctx->owner);
 
        ocsp = appctx->ctx.cli.p0;
 
index 1600ef4c831b486e07e3311efc3c043c951201ad..bffd3e395ee1e14c2c7466fd9f13e47e945213e2 100644 (file)
@@ -4262,7 +4262,7 @@ full:
  */
 static void http_stats_io_handler(struct appctx *appctx)
 {
-       struct stream_interface *si = appctx->owner;
+       struct stream_interface *si = cs_si(appctx->owner);
        struct stream *s = si_strm(si);
        struct channel *req = si_oc(si);
        struct channel *res = si_ic(si);
@@ -4911,7 +4911,7 @@ static int cli_parse_show_stat(char **args, char *payload, struct appctx *appctx
        appctx->ctx.stats.scope_len = 0;
        appctx->ctx.stats.flags = STAT_SHNODE | STAT_SHDESC;
 
-       if ((strm_li(si_strm(appctx->owner))->bind_conf->level & ACCESS_LVL_MASK) >= ACCESS_LVL_OPER)
+       if ((strm_li(si_strm(cs_si(appctx->owner)))->bind_conf->level & ACCESS_LVL_MASK) >= ACCESS_LVL_OPER)
                appctx->ctx.stats.flags |= STAT_SHLGNDS;
 
        /* proxy is the default domain */
@@ -4967,7 +4967,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->owner);
+       return stats_dump_info_to_buffer(cs_si(appctx->owner));
 }
 
 /* This I/O handler runs as an applet embedded in a stream interface. It is
@@ -4975,12 +4975,12 @@ 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->owner, NULL, NULL);
+       return stats_dump_stat_to_buffer(cs_si(appctx->owner), NULL, NULL);
 }
 
 static int cli_io_handler_dump_json_schema(struct appctx *appctx)
 {
-       return stats_dump_json_schema_to_buffer(appctx->owner);
+       return stats_dump_json_schema_to_buffer(cs_si(appctx->owner));
 }
 
 int stats_allocate_proxy_counters_internal(struct extra_counters **counters,
index 331ee19a035cd8a82ee34cf477553e34bcf910c4..667123c1c71302e28dbfa0556914ba24473b73fa 100644 (file)
@@ -4391,7 +4391,7 @@ static int table_dump_entry_to_buffer(struct buffer *msg,
  */
 static int table_process_entry_per_key(struct appctx *appctx, char **args)
 {
-       struct stream_interface *si = appctx->owner;
+       struct stream_interface *si = cs_si(appctx->owner);
        struct stktable *t = appctx->ctx.table.target;
        struct stksess *ts;
        uint32_t uint32_key;
@@ -4646,7 +4646,7 @@ err_args:
  */
 static int cli_io_handler_table(struct appctx *appctx)
 {
-       struct stream_interface *si = appctx->owner;
+       struct stream_interface *si = cs_si(appctx->owner);
        struct stream *s = si_strm(si);
        struct ebmb_node *eb;
        int skip_entry;
index 622d6b82f5e39e177508a6d0d5dc5009eb70c2ea..dd6ae6f8aff0080465b2b6f7b877e996f659f156 100644 (file)
@@ -2789,7 +2789,7 @@ void stream_dump_and_crash(enum obj_type *obj, int rate)
                if (!appctx)
                        return;
                ptr = appctx;
-               s = si_strm(appctx->owner);
+               s = si_strm(cs_si(appctx->owner));
                if (!s)
                        return;
        }
@@ -3476,7 +3476,7 @@ static int cli_parse_show_sess(char **args, char *payload, struct appctx *appctx
        /* let's set our own stream's epoch to the current one and increment
         * it so that we know which streams were already there before us.
         */
-       si_strm(appctx->owner)->stream_epoch = _HA_ATOMIC_FETCH_ADD(&stream_epoch, 1);
+       si_strm(cs_si(appctx->owner))->stream_epoch = _HA_ATOMIC_FETCH_ADD(&stream_epoch, 1);
        return 0;
 }
 
@@ -3487,7 +3487,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 stream_interface *si = appctx->owner;
+       struct stream_interface *si = cs_si(appctx->owner);
        struct connection *conn;
 
        thread_isolate();
@@ -3539,7 +3539,7 @@ static int cli_io_handler_dump_sess(struct appctx *appctx)
                        else {
                                /* check if we've found a stream created after issuing the "show sess" */
                                curr_strm = LIST_ELEM(appctx->ctx.sess.bref.ref, struct stream *, list);
-                               if ((int)(curr_strm->stream_epoch - si_strm(appctx->owner)->stream_epoch) > 0)
+                               if ((int)(curr_strm->stream_epoch - si_strm(cs_si(appctx->owner))->stream_epoch) > 0)
                                        done = 1;
                        }