]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: stconn: rename cs_{check,strm,strm_task} to sc_strm_*
authorWilly Tarreau <w@1wt.eu>
Wed, 18 May 2022 14:10:52 +0000 (16:10 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 27 May 2022 17:33:34 +0000 (19:33 +0200)
These functions return the app-layer associated with an stconn, which
is a check, a stream or a stream's task. They're used a lot to access
channels, flags and for waking up tasks. Let's just name them
appropriately for the stream connector.

21 files changed:
addons/promex/service-prometheus.c
include/haproxy/applet.h
include/haproxy/conn_stream.h
include/haproxy/cs_utils.h
src/cache.c
src/check.c
src/cli.c
src/conn_stream.c
src/connection.c
src/debug.c
src/flt_spoe.c
src/hlua.c
src/http_client.c
src/log.c
src/mux_fcgi.c
src/mux_h1.c
src/peers.c
src/sink.c
src/stats.c
src/stick_table.c
src/stream.c

index 940aac4601badec7bac396a71592d476fa0ea677..23a27d3a233449c0e3ebdbc5cfc3e0da3ab39fc5 100644 (file)
@@ -1504,7 +1504,7 @@ static int promex_appctx_init(struct appctx *appctx)
 static void promex_appctx_handle_io(struct appctx *appctx)
 {
        struct stconn *cs = appctx_cs(appctx);
-       struct stream *s = __cs_strm(cs);
+       struct stream *s = __sc_strm(cs);
        struct channel *req = sc_oc(cs);
        struct channel *res = sc_ic(cs);
        struct htx *req_htx, *res_htx;
index 8318f725bf54c2f3ceb41b557dade2981fd086d3..eb5e42a07cfcd6595ccb39ba8ae06be72bc13241 100644 (file)
@@ -121,11 +121,11 @@ static inline struct stconn *appctx_cs(const struct appctx *appctx)
 }
 
 /* returns the stream the appctx is attached to. Note that a stream *must*
- * be attached, as we use an unchecked dereference via __cs_strm().
+ * be attached, as we use an unchecked dereference via __sc_strm().
  */
 static inline struct stream *appctx_strm(const struct appctx *appctx)
 {
-       return __cs_strm(appctx->sedesc->sc);
+       return __sc_strm(appctx->sedesc->sc);
 }
 
 /* writes chunk <chunk> into the input channel of the stream attached to this
index d297e8ed24831189bc58e808a5b47a924baa6485..cad043aec06642501b398e96eb8a88ec7be41540 100644 (file)
@@ -186,30 +186,30 @@ static inline struct appctx *cs_appctx(const struct stconn *cs)
 }
 
 /* Returns the stream from a cs if the application is a stream. Otherwise
- * NULL is returned. __cs_strm() returns the stream without any control
- * while cs_strm() check the application type.
+ * NULL is returned. __sc_strm() returns the stream without any control
+ * while sc_strm() check the application type.
  */
-static inline struct stream *__cs_strm(const struct stconn *cs)
+static inline struct stream *__sc_strm(const struct stconn *cs)
 {
        return __objt_stream(cs->app);
 }
 
-static inline struct stream *cs_strm(const struct stconn *cs)
+static inline struct stream *sc_strm(const struct stconn *cs)
 {
        if (obj_type(cs->app) == OBJ_TYPE_STREAM)
-               return __cs_strm(cs);
+               return __sc_strm(cs);
        return NULL;
 }
 
 /* Returns the healthcheck from a cs if the application is a
- * healthcheck. Otherwise NULL is returned. __cs_check() returns the healthcheck
- * without any control while cs_check() check the application type.
+ * healthcheck. Otherwise NULL is returned. __sc_check() returns the healthcheck
+ * without any control while sc_check() check the application type.
  */
-static inline struct check *__cs_check(const struct stconn *cs)
+static inline struct check *__sc_check(const struct stconn *cs)
 {
        return __objt_check(cs->app);
 }
-static inline struct check *cs_check(const struct stconn *cs)
+static inline struct check *sc_check(const struct stconn *cs)
 {
        if (obj_type(cs->app) == OBJ_TYPE_CHECK)
                return __objt_check(cs->app);
index ee1c1f045a146b3974034b4dd8e5223b7a8e30f1..db6cde61ebe11b159acd1426db1cbd415ff42ff2 100644 (file)
@@ -44,7 +44,7 @@ void cs_conn_sync_send(struct stconn *cs);
 /* returns the channel which receives data from this stream connector (input channel) */
 static inline struct channel *sc_ic(struct stconn *cs)
 {
-       struct stream *strm = __cs_strm(cs);
+       struct stream *strm = __sc_strm(cs);
 
        return ((cs->flags & SC_FL_ISBACK) ? &(strm->res) : &(strm->req));
 }
@@ -52,7 +52,7 @@ static inline struct channel *sc_ic(struct stconn *cs)
 /* returns the channel which feeds data to this stream connector (output channel) */
 static inline struct channel *sc_oc(struct stconn *cs)
 {
-       struct stream *strm = __cs_strm(cs);
+       struct stream *strm = __sc_strm(cs);
 
        return ((cs->flags & SC_FL_ISBACK) ? &(strm->req) : &(strm->res));
 }
@@ -69,9 +69,9 @@ static inline struct buffer *sc_ob(struct stconn *cs)
        return &sc_oc(cs)->buf;
 }
 /* returns the stream's task associated to this stream connector */
-static inline struct task *cs_strm_task(struct stconn *cs)
+static inline struct task *sc_strm_task(struct stconn *cs)
 {
-       struct stream *strm = __cs_strm(cs);
+       struct stream *strm = __sc_strm(cs);
 
        return strm->task;
 }
@@ -79,7 +79,7 @@ static inline struct task *cs_strm_task(struct stconn *cs)
 /* returns the stream connector on the other side. Used during forwarding. */
 static inline struct stconn *cs_opposite(struct stconn *cs)
 {
-       struct stream *strm = __cs_strm(cs);
+       struct stream *strm = __sc_strm(cs);
 
        return ((cs->flags & SC_FL_ISBACK) ? strm->scf : strm->scb);
 }
@@ -88,8 +88,8 @@ static inline struct stconn *cs_opposite(struct stconn *cs)
 /* to be called only when in SC_ST_DIS with SC_FL_ERR */
 static inline void cs_report_error(struct stconn *cs)
 {
-       if (!__cs_strm(cs)->conn_err_type)
-               __cs_strm(cs)->conn_err_type = STRM_ET_DATA_ERR;
+       if (!__sc_strm(cs)->conn_err_type)
+               __sc_strm(cs)->conn_err_type = STRM_ET_DATA_ERR;
 
        sc_oc(cs)->flags |= CF_WRITE_ERROR;
        sc_ic(cs)->flags |= CF_READ_ERROR;
@@ -100,7 +100,7 @@ static inline void cs_report_error(struct stconn *cs)
  */
 static inline void cs_set_state(struct stconn *cs, int state)
 {
-       cs->state = __cs_strm(cs)->prev_conn_state = state;
+       cs->state = __sc_strm(cs)->prev_conn_state = state;
 }
 
 /* returns a bit for a stream connector state, to match against SC_SB_* */
@@ -174,7 +174,7 @@ static inline const struct sockaddr_storage *cs_src(struct stconn *cs)
        if (cs->src)
                return cs->src;
        if (!(cs->flags & SC_FL_ISBACK))
-               return sess_src(strm_sess(__cs_strm(cs)));
+               return sess_src(strm_sess(__sc_strm(cs)));
        else {
                struct connection *conn = cs_conn(cs);
 
@@ -194,7 +194,7 @@ static inline const struct sockaddr_storage *cs_dst(struct stconn *cs)
        if (cs->dst)
                return cs->dst;
        if (!(cs->flags & SC_FL_ISBACK))
-               return sess_dst(strm_sess(__cs_strm(cs)));
+               return sess_dst(strm_sess(__sc_strm(cs)));
        else {
                struct connection *conn = cs_conn(cs);
 
@@ -218,7 +218,7 @@ static inline int cs_get_src(struct stconn *cs)
                return 1;
 
        if (!(cs->flags & SC_FL_ISBACK))
-               src = sess_src(strm_sess(__cs_strm(cs)));
+               src = sess_src(strm_sess(__sc_strm(cs)));
        else {
                struct connection *conn = cs_conn(cs);
 
@@ -248,7 +248,7 @@ static inline int cs_get_dst(struct stconn *cs)
                return 1;
 
        if (!(cs->flags & SC_FL_ISBACK))
-               dst = sess_dst(strm_sess(__cs_strm(cs)));
+               dst = sess_dst(strm_sess(__sc_strm(cs)));
        else {
                struct connection *conn = cs_conn(cs);
 
index e90bfb4db9104fcb7a4ba10d07035abc4b5133c7..636c26d4f81585fa172df47aef74060530335cac 100644 (file)
@@ -1505,7 +1505,7 @@ static void http_cache_io_handler(struct appctx *appctx)
 
                /* Skip response body for HEAD requests or in case of "304 Not
                 * Modified" response. */
-               if (__cs_strm(cs)->txn->meth == HTTP_METH_HEAD || ctx->send_notmodified)
+               if (__sc_strm(cs)->txn->meth == HTTP_METH_HEAD || ctx->send_notmodified)
                        appctx->st0 = HTX_CACHE_EOM;
                else
                        appctx->st0 = HTX_CACHE_DATA;
index c8fe49117310d14fc8d0a8f726a9fe7546591e01..7aafb79a1e24b8fc143ebf86dcf554aa89c922e9 100644 (file)
@@ -1012,7 +1012,7 @@ int httpchk_build_status_header(struct server *s, struct buffer *buf)
 int wake_srv_chk(struct stconn *cs)
 {
        struct connection *conn;
-       struct check *check = __cs_check(cs);
+       struct check *check = __sc_check(cs);
        struct email_alertq *q = container_of(check, typeof(*q), check);
        int ret = 0;
 
index d4aaa624a86ae1d088776b574556a91b662a2d32..e388d82f2b4e5f8191292371a8031ff2063103c6 100644 (file)
--- a/src/cli.c
+++ b/src/cli.c
@@ -900,7 +900,7 @@ static void cli_io_handler(struct appctx *appctx)
        struct stconn *cs = appctx_cs(appctx);
        struct channel *req = sc_oc(cs);
        struct channel *res = sc_ic(cs);
-       struct bind_conf *bind_conf = strm_li(__cs_strm(cs))->bind_conf;
+       struct bind_conf *bind_conf = strm_li(__sc_strm(cs))->bind_conf;
        int reql;
        int len;
 
@@ -1970,7 +1970,7 @@ static int _getsocks(char **args, char *payload, struct appctx *appctx, void *pr
        unsigned char *tmpbuf = NULL;
        struct cmsghdr *cmsg;
        struct stconn *cs = appctx_cs(appctx);
-       struct stream *s = __cs_strm(cs);
+       struct stream *s = __sc_strm(cs);
        struct connection *remote = cs_conn(cs_opposite(cs));
        struct msghdr msghdr;
        struct iovec iov;
index e15ba4d8aadeb0ef10daa3dc5aab9f8fd1e132bb..98137b884376fc3229925c43b3b541d22472d8ca 100644 (file)
@@ -258,7 +258,7 @@ int cs_attach_mux(struct stconn *cs, void *endp, void *ctx)
        se_fl_clr(sedesc, SE_FL_DETACHED);
        if (!conn->ctx)
                conn->ctx = cs;
-       if (cs_strm(cs)) {
+       if (sc_strm(cs)) {
                if (!cs->wait_event.tasklet) {
                        cs->wait_event.tasklet = tasklet_new();
                        if (!cs->wait_event.tasklet)
@@ -270,7 +270,7 @@ int cs_attach_mux(struct stconn *cs, void *endp, void *ctx)
 
                cs->app_ops = &sc_app_conn_ops;
        }
-       else if (cs_check(cs)) {
+       else if (sc_check(cs)) {
                if (!cs->wait_event.tasklet) {
                        cs->wait_event.tasklet = tasklet_new();
                        if (!cs->wait_event.tasklet)
@@ -295,7 +295,7 @@ static void cs_attach_applet(struct stconn *cs, void *endp)
        cs->sedesc->se = endp;
        sc_ep_set(cs, SE_FL_T_APPLET);
        sc_ep_clr(cs, SE_FL_DETACHED);
-       if (cs_strm(cs))
+       if (sc_strm(cs))
                cs->app_ops = &sc_app_applet_ops;
 }
 
@@ -390,7 +390,7 @@ static void cs_detach_endp(struct stconn **csp)
         *        connection related for now but this will evolved
         */
        cs->flags &= SC_FL_ISBACK;
-       if (cs_strm(cs))
+       if (sc_strm(cs))
                cs->app_ops = &sc_app_embedded_ops;
        else
                cs->app_ops = NULL;
@@ -482,13 +482,13 @@ struct appctx *cs_applet_create(struct stconn *cs, struct applet *app)
 {
        struct appctx *appctx;
 
-       DPRINTF(stderr, "registering handler %p for cs %p (was %p)\n", app, cs, cs_strm_task(cs));
+       DPRINTF(stderr, "registering handler %p for cs %p (was %p)\n", app, cs, sc_strm_task(cs));
 
        appctx = appctx_new_here(app, cs->sedesc);
        if (!appctx)
                return NULL;
        cs_attach_applet(cs, appctx);
-       appctx->t->nice = __cs_strm(cs)->task->nice;
+       appctx->t->nice = __sc_strm(cs)->task->nice;
        cs_cant_get(cs);
        appctx_wakeup(appctx);
 
@@ -518,7 +518,7 @@ static void sc_app_shutr(struct stconn *cs)
 
        if (sc_oc(cs)->flags & CF_SHUTW) {
                cs->state = SC_ST_DIS;
-               __cs_strm(cs)->conn_exp = TICK_ETERNITY;
+               __sc_strm(cs)->conn_exp = TICK_ETERNITY;
        }
        else if (cs->flags & SC_FL_NOHALF) {
                /* we want to immediately forward this close to the write side */
@@ -527,7 +527,7 @@ static void sc_app_shutr(struct stconn *cs)
 
        /* note that if the task exists, it must unregister itself once it runs */
        if (!(cs->flags & SC_FL_DONT_WAKE))
-               task_wakeup(cs_strm_task(cs), TASK_WOKEN_IO);
+               task_wakeup(sc_strm_task(cs), TASK_WOKEN_IO);
 }
 
 /*
@@ -580,12 +580,12 @@ static void sc_app_shutw(struct stconn *cs)
                cs_rx_shut_blk(cs);
                ic->flags |= CF_SHUTR;
                ic->rex = TICK_ETERNITY;
-               __cs_strm(cs)->conn_exp = TICK_ETERNITY;
+               __sc_strm(cs)->conn_exp = TICK_ETERNITY;
        }
 
        /* note that if the task exists, it must unregister itself once it runs */
        if (!(cs->flags & SC_FL_DONT_WAKE))
-               task_wakeup(cs_strm_task(cs), TASK_WOKEN_IO);
+               task_wakeup(sc_strm_task(cs), TASK_WOKEN_IO);
 }
 
 /* default chk_rcv function for scheduled tasks */
@@ -604,7 +604,7 @@ static void sc_app_chk_rcv(struct stconn *cs)
        else {
                /* (re)start reading */
                if (!(cs->flags & SC_FL_DONT_WAKE))
-                       task_wakeup(cs_strm_task(cs), TASK_WOKEN_IO);
+                       task_wakeup(sc_strm_task(cs), TASK_WOKEN_IO);
        }
 }
 
@@ -632,7 +632,7 @@ static void sc_app_chk_snd(struct stconn *cs)
                oc->wex = tick_add_ifset(now_ms, oc->wto);
 
        if (!(cs->flags & SC_FL_DONT_WAKE))
-               task_wakeup(cs_strm_task(cs), TASK_WOKEN_IO);
+               task_wakeup(sc_strm_task(cs), TASK_WOKEN_IO);
 }
 
 /*
@@ -663,7 +663,7 @@ static void sc_app_shutr_conn(struct stconn *cs)
        if (sc_oc(cs)->flags & CF_SHUTW) {
                cs_conn_shut(cs);
                cs->state = SC_ST_DIS;
-               __cs_strm(cs)->conn_exp = TICK_ETERNITY;
+               __sc_strm(cs)->conn_exp = TICK_ETERNITY;
        }
        else if (cs->flags & SC_FL_NOHALF) {
                /* we want to immediately forward this close to the write side */
@@ -749,7 +749,7 @@ static void sc_app_shutw_conn(struct stconn *cs)
                cs_rx_shut_blk(cs);
                ic->flags |= CF_SHUTR;
                ic->rex = TICK_ETERNITY;
-               __cs_strm(cs)->conn_exp = TICK_ETERNITY;
+               __sc_strm(cs)->conn_exp = TICK_ETERNITY;
        }
 }
 
@@ -860,7 +860,7 @@ static void sc_app_chk_snd_conn(struct stconn *cs)
                    !cs_state_in(cs->state, SC_SB_EST))))) {
        out_wakeup:
                if (!(cs->flags & SC_FL_DONT_WAKE))
-                       task_wakeup(cs_strm_task(cs), TASK_WOKEN_IO);
+                       task_wakeup(sc_strm_task(cs), TASK_WOKEN_IO);
        }
 }
 
@@ -892,7 +892,7 @@ static void sc_app_shutr_applet(struct stconn *cs)
        if (sc_oc(cs)->flags & CF_SHUTW) {
                appctx_shut(__cs_appctx(cs));
                cs->state = SC_ST_DIS;
-               __cs_strm(cs)->conn_exp = TICK_ETERNITY;
+               __sc_strm(cs)->conn_exp = TICK_ETERNITY;
        }
        else if (cs->flags & SC_FL_NOHALF) {
                /* we want to immediately forward this close to the write side */
@@ -956,7 +956,7 @@ static void sc_app_shutw_applet(struct stconn *cs)
                cs_rx_shut_blk(cs);
                ic->flags |= CF_SHUTR;
                ic->rex = TICK_ETERNITY;
-               __cs_strm(cs)->conn_exp = TICK_ETERNITY;
+               __sc_strm(cs)->conn_exp = TICK_ETERNITY;
        }
 }
 
@@ -1113,7 +1113,7 @@ static void cs_notify(struct stconn *cs)
        struct channel *ic = sc_ic(cs);
        struct channel *oc = sc_oc(cs);
        struct stconn *cso = cs_opposite(cs);
-       struct task *task = cs_strm_task(cs);
+       struct task *task = sc_strm_task(cs);
 
        /* process consumer side */
        if (channel_is_empty(oc)) {
@@ -1224,7 +1224,7 @@ static void cs_notify(struct stconn *cs)
 
                task->expire = tick_first(task->expire, ic->analyse_exp);
                task->expire = tick_first(task->expire, oc->analyse_exp);
-               task->expire = tick_first(task->expire, __cs_strm(cs)->conn_exp);
+               task->expire = tick_first(task->expire, __sc_strm(cs)->conn_exp);
 
                task_queue(task);
        }
@@ -1277,7 +1277,7 @@ static void cs_conn_read0(struct stconn *cs)
        cs_done_get(cs);
 
        cs->state = SC_ST_DIS;
-       __cs_strm(cs)->conn_exp = TICK_ETERNITY;
+       __sc_strm(cs)->conn_exp = TICK_ETERNITY;
        return;
 }
 
@@ -1410,7 +1410,7 @@ static int cs_conn_recv(struct stconn *cs)
        }
 
        /* now we'll need a input buffer for the stream */
-       if (!cs_alloc_ibuf(cs, &(__cs_strm(cs)->buffer_wait)))
+       if (!cs_alloc_ibuf(cs, &(__sc_strm(cs)->buffer_wait)))
                goto end_recv;
 
        /* For an HTX stream, if the buffer is stuck (no output data with some
@@ -1422,7 +1422,7 @@ static int cs_conn_recv(struct stconn *cs)
         * NOTE: A possible optim may be to let the mux decides if defrag is
         *       required or not, depending on amount of data to be xferred.
         */
-       if (IS_HTX_STRM(__cs_strm(cs)) && !co_data(ic)) {
+       if (IS_HTX_STRM(__sc_strm(cs)) && !co_data(ic)) {
                struct htx *htx = htxbuf(&ic->buf);
 
                if (htx_is_not_empty(htx) && ((htx->flags & HTX_FL_FRAGMENTED) || htx_space_wraps(htx)))
@@ -1430,7 +1430,7 @@ static int cs_conn_recv(struct stconn *cs)
        }
 
        /* Instruct the mux it must subscribed for read events */
-       flags |= ((!conn_is_back(conn) && (__cs_strm(cs)->be->options & PR_O_ABRT_CLOSE)) ? CO_RFL_KEEP_RECV : 0);
+       flags |= ((!conn_is_back(conn) && (__sc_strm(cs)->be->options & PR_O_ABRT_CLOSE)) ? CO_RFL_KEEP_RECV : 0);
 
        /* Important note : if we're called with POLL_IN|POLL_HUP, it means the read polling
         * was enabled, which implies that the recv buffer was not full. So we have a guarantee
@@ -1643,7 +1643,7 @@ int cs_conn_sync_recv(struct stconn *cs)
 static int cs_conn_send(struct stconn *cs)
 {
        struct connection *conn = __cs_conn(cs);
-       struct stream *s = __cs_strm(cs);
+       struct stream *s = __sc_strm(cs);
        struct channel *oc = sc_oc(cs);
        int ret;
        int did_send = 0;
@@ -1850,12 +1850,12 @@ static int cs_conn_process(struct stconn *cs)
        if (!(conn->flags & (CO_FL_WAIT_XPRT | CO_FL_EARLY_SSL_HS)) &&
            sc_ep_test(cs, SE_FL_WAIT_FOR_HS)) {
                sc_ep_clr(cs, SE_FL_WAIT_FOR_HS);
-               task_wakeup(cs_strm_task(cs), TASK_WOKEN_MSG);
+               task_wakeup(sc_strm_task(cs), TASK_WOKEN_MSG);
        }
 
        if (!cs_state_in(cs->state, SC_SB_EST|SC_SB_DIS|SC_SB_CLO) &&
            (conn->flags & CO_FL_WAIT_XPRT) == 0) {
-               __cs_strm(cs)->conn_exp = TICK_ETERNITY;
+               __sc_strm(cs)->conn_exp = TICK_ETERNITY;
                oc->flags |= CF_WRITE_NULL;
                if (cs->state == SC_ST_CON)
                        cs->state = SC_ST_RDY;
@@ -1891,7 +1891,7 @@ static int cs_conn_process(struct stconn *cs)
         * stream connector status.
         */
        cs_notify(cs);
-       stream_release_buffers(__cs_strm(cs));
+       stream_release_buffers(__sc_strm(cs));
        return 0;
 }
 
@@ -1915,7 +1915,7 @@ struct task *cs_conn_io_cb(struct task *t, void *ctx, unsigned int state)
        if (ret != 0)
                cs_conn_process(cs);
 
-       stream_release_buffers(__cs_strm(cs));
+       stream_release_buffers(__sc_strm(cs));
        return t;
 }
 
@@ -1944,7 +1944,7 @@ static int cs_applet_process(struct stconn *cs)
 
        /* update the stream connector, channels, and possibly wake the stream up */
        cs_notify(cs);
-       stream_release_buffers(__cs_strm(cs));
+       stream_release_buffers(__sc_strm(cs));
 
        /* cs_notify may have passed through chk_snd and released some
         * RXBLK flags. Process_stream will consider those flags to wake up the
index e4d26dd4e90e2c2e26f905a9e261034c6c386aeb..53ac9a66535408ef3ce2bffc5b2a721efea2f6aa 100644 (file)
@@ -1188,11 +1188,11 @@ int conn_send_proxy(struct connection *conn, unsigned int flag)
                 * send a LOCAL line (eg: for use with health checks).
                 */
 
-               if (cs && cs_strm(cs)) {
+               if (cs && sc_strm(cs)) {
                        ret = make_proxy_line(trash.area, trash.size,
                                              objt_server(conn->target),
                                              cs_conn(cs_opposite(cs)),
-                                             __cs_strm(cs));
+                                             __sc_strm(cs));
                }
                else {
                        /* The target server expects a LOCAL line to be sent first. Retrieving
index 53ab1597d428dffa5a2917083fa41c24e6845999..5dcd96ed30499889bdd83fe3b21712354dc0e305 100644 (file)
@@ -251,9 +251,9 @@ 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 = cs_strm(appctx_cs((struct appctx *)task->context));
+               s = sc_strm(appctx_cs((struct appctx *)task->context));
        else if (task->process == cs_conn_io_cb && task->context)
-               s = cs_strm(((struct stconn *)task->context));
+               s = sc_strm(((struct stconn *)task->context));
 
        if (s)
                stream_dump(buf, s, pfx, '\n');
index 5e64a82d260d4d1575f55b4bedd23a4ca40fd386..47537d770c7fbacbee809f903a83d138b375eab6 100644 (file)
@@ -1400,7 +1400,7 @@ spoe_handle_connect_appctx(struct appctx *appctx)
        if (!cs_state_in(cs->state, SC_SB_RDY|SC_SB_EST)) {
                /* not connected yet */
                cs_rx_endp_more(cs);
-               task_wakeup(__cs_strm(cs)->task, TASK_WOKEN_MSG);
+               task_wakeup(__sc_strm(cs)->task, TASK_WOKEN_MSG);
                goto stop;
        }
 
@@ -1706,7 +1706,7 @@ static int
 spoe_handle_processing_appctx(struct appctx *appctx)
 {
        struct stconn      *cs    = appctx_cs(appctx);
-       struct server           *srv   = objt_server(__cs_strm(cs)->target);
+       struct server           *srv   = objt_server(__sc_strm(cs)->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;
 
index eb1a062f08c32d0761b7094dde8d003ea48e12f0..64b0527f380a3728095dd9e1b0b5d2b0cfd77fb3 100644 (file)
@@ -1941,7 +1941,7 @@ static void hlua_socket_handler(struct appctx *appctx)
                sc_ic(cs)->flags |= CF_READ_NULL;
                notification_wake(&ctx->wake_on_read);
                notification_wake(&ctx->wake_on_write);
-               stream_shutdown(__cs_strm(cs), SF_ERR_KILLED);
+               stream_shutdown(__sc_strm(cs), SF_ERR_KILLED);
        }
 
        /* If we can't write, wakeup the pending write signals. */
@@ -2402,7 +2402,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;
        cs = appctx_cs(appctx);
-       s = __cs_strm(cs);
+       s = __sc_strm(cs);
 
        /* Check for connection close. */
        if (channel_output_closed(&s->req)) {
@@ -2843,7 +2843,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;
        cs = appctx_cs(appctx);
-       s = __cs_strm(cs);
+       s = __sc_strm(cs);
 
        if (!sockaddr_alloc(&cs_opposite(cs)->dst, addr, sizeof(*addr))) {
                xref_unlock(&socket->xref, peer);
@@ -9217,7 +9217,7 @@ static int hlua_applet_tcp_init(struct appctx *ctx)
 {
        struct hlua_tcp_ctx *tcp_ctx = applet_reserve_svcctx(ctx, sizeof(*tcp_ctx));
        struct stconn *cs = appctx_cs(ctx);
-       struct stream *strm = __cs_strm(cs);
+       struct stream *strm = __sc_strm(cs);
        struct hlua *hlua;
        struct task *task;
        char **arg;
@@ -9315,7 +9315,7 @@ void hlua_applet_tcp_fct(struct appctx *ctx)
 {
        struct hlua_tcp_ctx *tcp_ctx = ctx->svcctx;
        struct stconn *cs = appctx_cs(ctx);
-       struct stream *strm = __cs_strm(cs);
+       struct stream *strm = __sc_strm(cs);
        struct channel *res = sc_ic(cs);
        struct act_rule *rule = ctx->rule;
        struct proxy *px = strm->be;
@@ -9408,7 +9408,7 @@ static int hlua_applet_http_init(struct appctx *ctx)
 {
        struct hlua_http_ctx *http_ctx = applet_reserve_svcctx(ctx, sizeof(*http_ctx));
        struct stconn *cs = appctx_cs(ctx);
-       struct stream *strm = __cs_strm(cs);
+       struct stream *strm = __sc_strm(cs);
        struct http_txn *txn;
        struct hlua *hlua;
        char **arg;
@@ -9511,7 +9511,7 @@ void hlua_applet_http_fct(struct appctx *ctx)
 {
        struct hlua_http_ctx *http_ctx = ctx->svcctx;
        struct stconn *cs = appctx_cs(ctx);
-       struct stream *strm = __cs_strm(cs);
+       struct stream *strm = __sc_strm(cs);
        struct channel *req = sc_oc(cs);
        struct channel *res = sc_ic(cs);
        struct act_rule *rule = ctx->rule;
index 4fb41ac019e788352c3427e5cf706b632aaf770a..910cd0f5f024fddca946b5fd2c6f1fd274012de3 100644 (file)
@@ -637,7 +637,7 @@ static void httpclient_applet_io_handler(struct appctx *appctx)
 {
        struct httpclient *hc = appctx->svcctx;
        struct stconn *cs = appctx_cs(appctx);
-       struct stream *s = __cs_strm(cs);
+       struct stream *s = __sc_strm(cs);
        struct channel *req = &s->req;
        struct channel *res = &s->res;
        struct htx_blk *blk = NULL;
index a767f596ebb7d17390150ff78832681f849675b6..6eade9aeeb558a5c9bb376285d954392e9e922e1 100644 (file)
--- a/src/log.c
+++ b/src/log.c
@@ -3560,7 +3560,7 @@ static void syslog_io_handler(struct appctx *appctx)
 {
        static THREAD_LOCAL struct ist metadata[LOG_META_FIELDS];
        struct stconn *cs = appctx_cs(appctx);
-       struct stream *s = __cs_strm(cs);
+       struct stream *s = __sc_strm(cs);
        struct proxy *frontend = strm_fe(s);
        struct listener *l = strm_li(s);
        struct buffer *buf = get_trash_chunk();
index bd95aa5b1404fec097e465b48429b6bdca42e62b..311a603c80769018bf545f8be823505ba3f29c98 100644 (file)
@@ -1236,8 +1236,8 @@ static int fcgi_set_default_param(struct fcgi_conn *fconn, struct fcgi_strm *fst
                                  struct fcgi_strm_params *params)
 {
        struct connection *cli_conn = objt_conn(fstrm->sess->origin);
-       const struct sockaddr_storage *src = (cs_check(fcgi_strm_sc(fstrm)) ? conn_src(fconn->conn) : cs_src(cs_opposite(fcgi_strm_sc(fstrm))));
-       const struct sockaddr_storage *dst = (cs_check(fcgi_strm_sc(fstrm)) ? conn_dst(fconn->conn) : cs_dst(cs_opposite(fcgi_strm_sc(fstrm))));
+       const struct sockaddr_storage *src = (sc_check(fcgi_strm_sc(fstrm)) ? conn_src(fconn->conn) : cs_src(cs_opposite(fcgi_strm_sc(fstrm))));
+       const struct sockaddr_storage *dst = (sc_check(fcgi_strm_sc(fstrm)) ? conn_dst(fconn->conn) : cs_dst(cs_opposite(fcgi_strm_sc(fstrm))));
        struct ist p;
 
        if (!sl)
@@ -3319,11 +3319,11 @@ static void fcgi_strm_capture_bad_message(struct fcgi_conn *fconn, struct fcgi_s
        struct proxy *other_end;
        union error_snapshot_ctx ctx;
 
-       if (fcgi_strm_sc(fstrm) && cs_strm(fcgi_strm_sc(fstrm))) {
+       if (fcgi_strm_sc(fstrm) && sc_strm(fcgi_strm_sc(fstrm))) {
                if (sess == NULL)
-                       sess = __cs_strm(fcgi_strm_sc(fstrm))->sess;
+                       sess = __sc_strm(fcgi_strm_sc(fstrm))->sess;
                if (!(h1m->flags & H1_MF_RESP))
-                       other_end = __cs_strm(fcgi_strm_sc(fstrm))->be;
+                       other_end = __sc_strm(fcgi_strm_sc(fstrm))->be;
                else
                        other_end = sess->fe;
        } else
index 87a2970ebad35a31065f8239d2a9cedd769a5ea2..0c107fa4253dbe1dd8550c69e342365547d0ea6f 100644 (file)
@@ -1418,11 +1418,11 @@ static void h1_capture_bad_message(struct h1c *h1c, struct h1s *h1s,
        struct proxy *other_end;
        union error_snapshot_ctx ctx;
 
-       if ((h1c->flags & H1C_F_ST_ATTACHED) && cs_strm(h1s_sc(h1s))) {
+       if ((h1c->flags & H1C_F_ST_ATTACHED) && sc_strm(h1s_sc(h1s))) {
                if (sess == NULL)
-                       sess = __cs_strm(h1s_sc(h1s))->sess;
+                       sess = __sc_strm(h1s_sc(h1s))->sess;
                if (!(h1m->flags & H1_MF_RESP))
-                       other_end = __cs_strm(h1s_sc(h1s))->be;
+                       other_end = __sc_strm(h1s_sc(h1s))->be;
                else
                        other_end = sess->fe;
        } else
index a4270c79a70ede3b2d359cb93daf61c997c4d70d..cfa0b53f441919ab04bc15a63f8b253b9517897d 100644 (file)
@@ -2851,7 +2851,7 @@ static inline void init_connected_peer(struct peer *peer, struct peers *peers)
 static void peer_io_handler(struct appctx *appctx)
 {
        struct stconn *cs = appctx_cs(appctx);
-       struct stream *s = __cs_strm(cs);
+       struct stream *s = __sc_strm(cs);
        struct peers *curpeers = strm_fe(s)->parent;
        struct peer *curpeer = NULL;
        int reql = 0;
@@ -3818,7 +3818,7 @@ static int peers_dump_peer(struct buffer *msg, struct stconn *cs, struct peer *p
                                                                        appctx->t ? appctx->t->calls : 0);
 
        peer_cs = appctx_cs(peer->appctx);
-       peer_s = __cs_strm(peer_cs);
+       peer_s = __sc_strm(peer_cs);
 
        chunk_appendf(&trash, " state=%s", cs_state_str(cs_opposite(peer_cs)->state));
 
index bfefea182b88e072496b35608c5570d4e4c0fd6c..831c5b444d90af68ce48c7155e5dad80e60caf60 100644 (file)
@@ -300,7 +300,7 @@ void sink_setup_proxy(struct proxy *px)
 static void sink_forward_io_handler(struct appctx *appctx)
 {
        struct stconn *cs = appctx_cs(appctx);
-       struct stream *s = __cs_strm(cs);
+       struct stream *s = __sc_strm(cs);
        struct sink *sink = strm_fe(s)->parent;
        struct sink_forward_target *sft = appctx->svcctx;
        struct ring *ring = sink->ctx.ring;
@@ -439,7 +439,7 @@ close:
 static void sink_forward_oc_io_handler(struct appctx *appctx)
 {
        struct stconn *cs = appctx_cs(appctx);
-       struct stream *s = __cs_strm(cs);
+       struct stream *s = __sc_strm(cs);
        struct sink *sink = strm_fe(s)->parent;
        struct sink_forward_target *sft = appctx->svcctx;
        struct ring *ring = sink->ctx.ring;
index 494d143ee41cd539e237308c357e231ebcdd308d..6cc19dba42cb232cd879575ad38fef04acc32b8f 100644 (file)
@@ -3018,7 +3018,7 @@ int stats_dump_proxy_to_buffer(struct stconn *cs, struct htx *htx,
 {
        struct appctx *appctx = __cs_appctx(cs);
        struct show_stat_ctx *ctx = appctx->svcctx;
-       struct stream *s = __cs_strm(cs);
+       struct stream *s = __sc_strm(cs);
        struct channel *rep = sc_ic(cs);
        struct server *sv, *svs;        /* server and server-state, server-state=server or server->track */
        struct listener *l;
@@ -3827,7 +3827,7 @@ static int stats_dump_stat_to_buffer(struct stconn *cs, struct htx *htx,
  */
 static int stats_process_http_post(struct stconn *cs)
 {
-       struct stream *s = __cs_strm(cs);
+       struct stream *s = __sc_strm(cs);
        struct appctx *appctx = __cs_appctx(cs);
        struct show_stat_ctx *ctx = appctx->svcctx;
 
@@ -4163,7 +4163,7 @@ static int stats_process_http_post(struct stconn *cs)
 
 static int stats_send_http_headers(struct stconn *cs, struct htx *htx)
 {
-       struct stream *s = __cs_strm(cs);
+       struct stream *s = __sc_strm(cs);
        struct uri_auth *uri = s->be->uri_auth;
        struct appctx *appctx = __cs_appctx(cs);
        struct show_stat_ctx *ctx = appctx->svcctx;
@@ -4218,7 +4218,7 @@ static int stats_send_http_headers(struct stconn *cs, struct htx *htx)
 static int stats_send_http_redirect(struct stconn *cs, struct htx *htx)
 {
        char scope_txt[STAT_SCOPE_TXT_MAXLEN + sizeof STAT_SCOPE_PATTERN];
-       struct stream *s = __cs_strm(cs);
+       struct stream *s = __sc_strm(cs);
        struct uri_auth *uri = s->be->uri_auth;
        struct appctx *appctx = __cs_appctx(cs);
        struct show_stat_ctx *ctx = appctx->svcctx;
@@ -4284,7 +4284,7 @@ static void http_stats_io_handler(struct appctx *appctx)
 {
        struct show_stat_ctx *ctx = appctx->svcctx;
        struct stconn *cs = appctx_cs(appctx);
-       struct stream *s = __cs_strm(cs);
+       struct stream *s = __sc_strm(cs);
        struct channel *req = sc_oc(cs);
        struct channel *res = sc_ic(cs);
        struct htx *req_htx, *res_htx;
index a3fc6f35c585005da7551e612d53addc1489d0a2..b9ad124b9662dbd98aa32da9eca9e1c49c71b59a 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 = __cs_strm(appctx_cs(appctx));
+       struct stream *s = __sc_strm(appctx_cs(appctx));
 
        chunk_appendf(msg, "# table: %s, type: %s, size:%d, used:%d\n",
                     t->id, stktable_types[t->type].kw, t->size, t->current);
@@ -4664,7 +4664,7 @@ static int cli_io_handler_table(struct appctx *appctx)
 {
        struct show_table_ctx *ctx = appctx->svcctx;
        struct stconn *cs = appctx_cs(appctx);
-       struct stream *s = __cs_strm(cs);
+       struct stream *s = __sc_strm(cs);
        struct ebmb_node *eb;
        int skip_entry;
        int show = ctx->action == STK_CLI_ACT_SHOW;
index 882286de08b0b5491c5711c1fdc561dea0dedbc3..1c7c0d660a6019ac888a78e1a2e5216d71e42b99 100644 (file)
@@ -277,7 +277,7 @@ static void strm_trace(enum trace_level level, uint64_t mask, const struct trace
  */
 int stream_upgrade_from_cs(struct stconn *cs, struct buffer *input)
 {
-       struct stream *s = __cs_strm(cs);
+       struct stream *s = __sc_strm(cs);
        const struct mux_ops *mux = cs_conn_mux(cs);
 
        if (mux) {