CLEANUP: stconn: rename cs_{check,strm,strm_task} to sc_strm_*

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.
diff --git a/addons/promex/service-prometheus.c b/addons/promex/service-prometheus.c
index 940aac4..23a27d3 100644
--- a/addons/promex/service-prometheus.c
+++ b/addons/promex/service-prometheus.c
@@ -1504,7 +1504,7 @@
 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;
diff --git a/include/haproxy/applet.h b/include/haproxy/applet.h
index 8318f72..eb5e42a 100644
--- a/include/haproxy/applet.h
+++ b/include/haproxy/applet.h
@@ -121,11 +121,11 @@
 }
 
 /* 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
diff --git a/include/haproxy/conn_stream.h b/include/haproxy/conn_stream.h
index d297e8e..cad043a 100644
--- a/include/haproxy/conn_stream.h
+++ b/include/haproxy/conn_stream.h
@@ -186,30 +186,30 @@
 }
 
 /* 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);
diff --git a/include/haproxy/cs_utils.h b/include/haproxy/cs_utils.h
index ee1c1f0..db6cde6 100644
--- a/include/haproxy/cs_utils.h
+++ b/include/haproxy/cs_utils.h
@@ -44,7 +44,7 @@
 /* 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 @@
 /* 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 @@
 	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 @@
 /* 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 @@
 /* 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_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 @@
 	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 @@
 	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 @@
 		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 @@
 		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);
 
diff --git a/src/cache.c b/src/cache.c
index e90bfb4..636c26d 100644
--- a/src/cache.c
+++ b/src/cache.c
@@ -1505,7 +1505,7 @@
 
 		/* 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;
diff --git a/src/check.c b/src/check.c
index c8fe491..7aafb79 100644
--- a/src/check.c
+++ b/src/check.c
@@ -1012,7 +1012,7 @@
 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;
 
diff --git a/src/cli.c b/src/cli.c
index d4aaa62..e388d82 100644
--- a/src/cli.c
+++ b/src/cli.c
@@ -900,7 +900,7 @@
 	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 @@
 	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;
diff --git a/src/conn_stream.c b/src/conn_stream.c
index e15ba4d..98137b8 100644
--- a/src/conn_stream.c
+++ b/src/conn_stream.c
@@ -258,7 +258,7 @@
 	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 @@
 
 		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 @@
 	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 @@
 	 *        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 *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 @@
 
 	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 @@
 
 	/* 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 @@
 		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 @@
 	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 @@
 		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 @@
 	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 @@
 		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 @@
 	            !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 @@
 	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 @@
 		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 @@
 	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 @@
 
 		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 @@
 	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 @@
 	}
 
 	/* 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 @@
 	 * 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 @@
 	}
 
 	/* 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 @@
 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 @@
 	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 @@
 	 * stream connector status.
 	 */
 	cs_notify(cs);
-	stream_release_buffers(__cs_strm(cs));
+	stream_release_buffers(__sc_strm(cs));
 	return 0;
 }
 
@@ -1915,7 +1915,7 @@
 	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 @@
 
 	/* 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
diff --git a/src/connection.c b/src/connection.c
index e4d26dd..53ac9a6 100644
--- a/src/connection.c
+++ b/src/connection.c
@@ -1188,11 +1188,11 @@
 		 * 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
diff --git a/src/debug.c b/src/debug.c
index 53ab159..5dcd96e 100644
--- a/src/debug.c
+++ b/src/debug.c
@@ -251,9 +251,9 @@
 	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');
diff --git a/src/flt_spoe.c b/src/flt_spoe.c
index 5e64a82..47537d7 100644
--- a/src/flt_spoe.c
+++ b/src/flt_spoe.c
@@ -1400,7 +1400,7 @@
 	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 @@
 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;
 
diff --git a/src/hlua.c b/src/hlua.c
index eb1a062..64b0527 100644
--- a/src/hlua.c
+++ b/src/hlua.c
@@ -1941,7 +1941,7 @@
 		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 @@
 	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 @@
 	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 @@
 {
 	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 @@
 {
 	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 @@
 {
 	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 @@
 {
 	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;
diff --git a/src/http_client.c b/src/http_client.c
index 4fb41ac..910cd0f 100644
--- a/src/http_client.c
+++ b/src/http_client.c
@@ -637,7 +637,7 @@
 {
 	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;
diff --git a/src/log.c b/src/log.c
index a767f59..6eade9a 100644
--- a/src/log.c
+++ b/src/log.c
@@ -3560,7 +3560,7 @@
 {
 	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();
diff --git a/src/mux_fcgi.c b/src/mux_fcgi.c
index bd95aa5..311a603 100644
--- a/src/mux_fcgi.c
+++ b/src/mux_fcgi.c
@@ -1236,8 +1236,8 @@
 				  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 @@
 	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
diff --git a/src/mux_h1.c b/src/mux_h1.c
index 87a2970..0c107fa 100644
--- a/src/mux_h1.c
+++ b/src/mux_h1.c
@@ -1418,11 +1418,11 @@
 	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
diff --git a/src/peers.c b/src/peers.c
index a4270c7..cfa0b53 100644
--- a/src/peers.c
+++ b/src/peers.c
@@ -2851,7 +2851,7 @@
 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 @@
 	                                                                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));
 
diff --git a/src/sink.c b/src/sink.c
index bfefea1..831c5b4 100644
--- a/src/sink.c
+++ b/src/sink.c
@@ -300,7 +300,7 @@
 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 @@
 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;
diff --git a/src/stats.c b/src/stats.c
index 494d143..6cc19db 100644
--- a/src/stats.c
+++ b/src/stats.c
@@ -3018,7 +3018,7 @@
 {
 	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_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_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_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 @@
 {
 	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;
diff --git a/src/stick_table.c b/src/stick_table.c
index a3fc6f3..b9ad124 100644
--- a/src/stick_table.c
+++ b/src/stick_table.c
@@ -4242,7 +4242,7 @@
                                      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 @@
 {
 	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;
diff --git a/src/stream.c b/src/stream.c
index 882286d..1c7c0d66 100644
--- a/src/stream.c
+++ b/src/stream.c
@@ -277,7 +277,7 @@
  */
 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) {