CLEANUP: stconn: rename cs_appctx() to sc_appctx()
Nothing special, just s/cs/sc/, roughly 50-60 entries.
diff --git a/include/haproxy/conn_stream.h b/include/haproxy/conn_stream.h
index aa186b3..a7c9e36 100644
--- a/include/haproxy/conn_stream.h
+++ b/include/haproxy/conn_stream.h
@@ -171,17 +171,17 @@
}
/* Returns the appctx from a cs if the endpoint is an appctx. Otherwise
- * NULL is returned. __cs_appctx() returns the appctx without any control
- * while cs_appctx() check the endpoint type.
+ * NULL is returned. __sc_appctx() returns the appctx without any control
+ * while sc_appctx() checks the endpoint type.
*/
-static inline struct appctx *__cs_appctx(const struct stconn *cs)
+static inline struct appctx *__sc_appctx(const struct stconn *cs)
{
return __cs_endp_target(cs);
}
-static inline struct appctx *cs_appctx(const struct stconn *cs)
+static inline struct appctx *sc_appctx(const struct stconn *cs)
{
if (sc_ep_test(cs, SE_FL_T_APPLET))
- return __cs_appctx(cs);
+ return __sc_appctx(cs);
return NULL;
}
diff --git a/src/backend.c b/src/backend.c
index 131e5a4..091c598 100644
--- a/src/backend.c
+++ b/src/backend.c
@@ -2174,7 +2174,7 @@
* means no appctx are attached to the CS. Otherwise, it will be
* in SC_ST_RDY state. So, try to create the appctx now.
*/
- BUG_ON(cs_appctx(cs));
+ BUG_ON(sc_appctx(cs));
appctx = cs_applet_create(cs, objt_applet(s->target));
if (!appctx) {
/* No more memory, let's immediately abort. Force the
@@ -2447,7 +2447,7 @@
/* Here the appctx must exists because the CS was set to
* SC_ST_RDY state when the appctx was created.
*/
- BUG_ON(!cs_appctx(s->scb));
+ BUG_ON(!sc_appctx(s->scb));
if (tv_iszero(&s->logs.tv_request))
s->logs.tv_request = now;
diff --git a/src/cache.c b/src/cache.c
index 636c26d..22902a3 100644
--- a/src/cache.c
+++ b/src/cache.c
@@ -2686,7 +2686,7 @@
return 0;
/* Get appctx from the stream connector. */
- appctx = cs_appctx(smp->strm->scb);
+ appctx = sc_appctx(smp->strm->scb);
if (appctx && appctx->rule) {
cconf = appctx->rule->arg.act.p[0];
if (cconf) {
diff --git a/src/conn_stream.c b/src/conn_stream.c
index b2c45f8..7a16afd 100644
--- a/src/conn_stream.c
+++ b/src/conn_stream.c
@@ -368,7 +368,7 @@
}
}
else if (sc_ep_test(cs, SE_FL_T_APPLET)) {
- struct appctx *appctx = __cs_appctx(cs);
+ struct appctx *appctx = __sc_appctx(cs);
sc_ep_set(cs, SE_FL_ORPHAN);
cs->sedesc->sc = NULL;
@@ -876,7 +876,7 @@
{
struct channel *ic = sc_ic(cs);
- BUG_ON(!cs_appctx(cs));
+ BUG_ON(!sc_appctx(cs));
cs_rx_shut_blk(cs);
if (ic->flags & CF_SHUTR)
@@ -890,7 +890,7 @@
return;
if (sc_oc(cs)->flags & CF_SHUTW) {
- appctx_shut(__cs_appctx(cs));
+ appctx_shut(__sc_appctx(cs));
cs->state = SC_ST_DIS;
__sc_strm(cs)->conn_exp = TICK_ETERNITY;
}
@@ -912,7 +912,7 @@
struct channel *ic = sc_ic(cs);
struct channel *oc = sc_oc(cs);
- BUG_ON(!cs_appctx(cs));
+ BUG_ON(!sc_appctx(cs));
oc->flags &= ~CF_SHUTW_NOW;
if (oc->flags & CF_SHUTW)
@@ -927,7 +927,7 @@
}
/* on shutw we always wake the applet up */
- appctx_wakeup(__cs_appctx(cs));
+ appctx_wakeup(__sc_appctx(cs));
switch (cs->state) {
case SC_ST_RDY:
@@ -948,7 +948,7 @@
case SC_ST_QUE:
case SC_ST_TAR:
/* Note that none of these states may happen with applets */
- appctx_shut(__cs_appctx(cs));
+ appctx_shut(__sc_appctx(cs));
cs->state = SC_ST_DIS;
/* fall through */
default:
@@ -965,7 +965,7 @@
{
struct channel *ic = sc_ic(cs);
- BUG_ON(!cs_appctx(cs));
+ BUG_ON(!sc_appctx(cs));
DPRINTF(stderr, "%s: cs=%p, cs->state=%d ic->flags=%08x oc->flags=%08x\n",
__FUNCTION__,
@@ -973,7 +973,7 @@
if (!ic->pipe) {
/* (re)start reading */
- appctx_wakeup(__cs_appctx(cs));
+ appctx_wakeup(__sc_appctx(cs));
}
}
@@ -982,7 +982,7 @@
{
struct channel *oc = sc_oc(cs);
- BUG_ON(!cs_appctx(cs));
+ BUG_ON(!sc_appctx(cs));
DPRINTF(stderr, "%s: cs=%p, cs->state=%d ic->flags=%08x oc->flags=%08x\n",
__FUNCTION__,
@@ -1001,7 +1001,7 @@
if (!channel_is_empty(oc)) {
/* (re)start sending */
- appctx_wakeup(__cs_appctx(cs));
+ appctx_wakeup(__sc_appctx(cs));
}
}
@@ -1928,7 +1928,7 @@
{
struct channel *ic = sc_ic(cs);
- BUG_ON(!cs_appctx(cs));
+ BUG_ON(!sc_appctx(cs));
/* If the applet wants to write and the channel is closed, it's a
* broken pipe and it must be reported.
@@ -1953,6 +1953,6 @@
*/
if ((cs_rx_endp_ready(cs) && !cs_rx_blocked(cs)) ||
(cs_tx_endp_ready(cs) && !cs_tx_blocked(cs)))
- appctx_wakeup(__cs_appctx(cs));
+ appctx_wakeup(__sc_appctx(cs));
return 0;
}
diff --git a/src/hlua.c b/src/hlua.c
index 1fdfcf3..4fc952c 100644
--- a/src/hlua.c
+++ b/src/hlua.c
@@ -2747,7 +2747,7 @@
return 2;
}
- appctx = __cs_appctx(s->scf);
+ appctx = __sc_appctx(s->scf);
/* Check for connection established. */
if (csk_ctx->connected) {
diff --git a/src/http_ana.c b/src/http_ana.c
index 55c0a34..08a76b2 100644
--- a/src/http_ana.c
+++ b/src/http_ana.c
@@ -3973,7 +3973,7 @@
struct http_msg *msg = &txn->req;
struct uri_auth *uri_auth = s->be->uri_auth;
const char *h, *lookup, *end;
- struct appctx *appctx = __cs_appctx(s->scb);
+ struct appctx *appctx = __sc_appctx(s->scb);
struct show_stat_ctx *ctx = applet_reserve_svcctx(appctx, sizeof(*ctx));
struct htx *htx;
struct htx_sl *sl;
diff --git a/src/proxy.c b/src/proxy.c
index b3e2336..26a4ad8 100644
--- a/src/proxy.c
+++ b/src/proxy.c
@@ -2708,7 +2708,7 @@
*/
static int dump_servers_state(struct stconn *cs)
{
- struct appctx *appctx = __cs_appctx(cs);
+ struct appctx *appctx = __sc_appctx(cs);
struct show_srv_ctx *ctx = appctx->svcctx;
struct proxy *px = ctx->px;
struct server *srv;
diff --git a/src/resolvers.c b/src/resolvers.c
index 82dbd41..f46aaef 100644
--- a/src/resolvers.c
+++ b/src/resolvers.c
@@ -2592,7 +2592,7 @@
struct field *stats, size_t stats_count,
struct list *stat_modules)
{
- struct appctx *appctx = __cs_appctx(cs);
+ struct appctx *appctx = __sc_appctx(cs);
struct channel *rep = sc_ic(cs);
struct stats_module *mod;
size_t idx = 0;
@@ -2626,7 +2626,7 @@
struct field *stats, size_t stats_count,
struct list *stat_modules)
{
- struct appctx *appctx = __cs_appctx(cs);
+ struct appctx *appctx = __sc_appctx(cs);
struct show_stat_ctx *ctx = appctx->svcctx;
struct channel *rep = sc_ic(cs);
struct resolvers *resolver = ctx->obj1;
diff --git a/src/stats.c b/src/stats.c
index 6cc19db..5aee449 100644
--- a/src/stats.c
+++ b/src/stats.c
@@ -1814,7 +1814,7 @@
*/
static int stats_dump_fe_stats(struct stconn *cs, struct proxy *px)
{
- struct appctx *appctx = __cs_appctx(cs);
+ struct appctx *appctx = __sc_appctx(cs);
struct show_stat_ctx *ctx = appctx->svcctx;
struct field *stats = stat_l[STATS_DOMAIN_PROXY];
struct stats_module *mod;
@@ -1982,7 +1982,7 @@
*/
static int stats_dump_li_stats(struct stconn *cs, struct proxy *px, struct listener *l)
{
- struct appctx *appctx = __cs_appctx(cs);
+ struct appctx *appctx = __sc_appctx(cs);
struct show_stat_ctx *ctx = appctx->svcctx;
struct field *stats = stat_l[STATS_DOMAIN_PROXY];
struct stats_module *mod;
@@ -2494,7 +2494,7 @@
*/
static int stats_dump_sv_stats(struct stconn *cs, struct proxy *px, struct server *sv)
{
- struct appctx *appctx = __cs_appctx(cs);
+ struct appctx *appctx = __sc_appctx(cs);
struct show_stat_ctx *ctx = appctx->svcctx;
struct stats_module *mod;
struct field *stats = stat_l[STATS_DOMAIN_PROXY];
@@ -2820,7 +2820,7 @@
*/
static int stats_dump_be_stats(struct stconn *cs, struct proxy *px)
{
- struct appctx *appctx = __cs_appctx(cs);
+ struct appctx *appctx = __sc_appctx(cs);
struct show_stat_ctx *ctx = appctx->svcctx;
struct field *stats = stat_l[STATS_DOMAIN_PROXY];
struct stats_module *mod;
@@ -2862,7 +2862,7 @@
*/
static void stats_dump_html_px_hdr(struct stconn *cs, struct proxy *px)
{
- struct appctx *appctx = __cs_appctx(cs);
+ struct appctx *appctx = __sc_appctx(cs);
struct show_stat_ctx *ctx = appctx->svcctx;
char scope_txt[STAT_SCOPE_TXT_MAXLEN + sizeof STAT_SCOPE_PATTERN];
struct stats_module *mod;
@@ -2972,7 +2972,7 @@
*/
static void stats_dump_html_px_end(struct stconn *cs, struct proxy *px)
{
- struct appctx *appctx = __cs_appctx(cs);
+ struct appctx *appctx = __sc_appctx(cs);
struct show_stat_ctx *ctx = appctx->svcctx;
chunk_appendf(&trash, "</table>");
@@ -3016,7 +3016,7 @@
int stats_dump_proxy_to_buffer(struct stconn *cs, struct htx *htx,
struct proxy *px, struct uri_auth *uri)
{
- struct appctx *appctx = __cs_appctx(cs);
+ struct appctx *appctx = __sc_appctx(cs);
struct show_stat_ctx *ctx = appctx->svcctx;
struct stream *s = __sc_strm(cs);
struct channel *rep = sc_ic(cs);
@@ -3394,7 +3394,7 @@
*/
static void stats_dump_html_info(struct stconn *cs, struct uri_auth *uri)
{
- struct appctx *appctx = __cs_appctx(cs);
+ struct appctx *appctx = __sc_appctx(cs);
struct show_stat_ctx *ctx = appctx->svcctx;
unsigned int up = (now.tv_sec - start_date.tv_sec);
char scope_txt[STAT_SCOPE_TXT_MAXLEN + sizeof STAT_SCOPE_PATTERN];
@@ -3677,7 +3677,7 @@
struct htx *htx,
struct uri_auth *uri)
{
- struct appctx *appctx = __cs_appctx(cs);
+ struct appctx *appctx = __sc_appctx(cs);
struct show_stat_ctx *ctx = appctx->svcctx;
struct channel *rep = sc_ic(cs);
struct proxy *px;
@@ -3725,7 +3725,7 @@
static int stats_dump_stat_to_buffer(struct stconn *cs, struct htx *htx,
struct uri_auth *uri)
{
- struct appctx *appctx = __cs_appctx(cs);
+ struct appctx *appctx = __sc_appctx(cs);
struct show_stat_ctx *ctx = appctx->svcctx;
struct channel *rep = sc_ic(cs);
enum stats_domain domain = ctx->domain;
@@ -3828,7 +3828,7 @@
static int stats_process_http_post(struct stconn *cs)
{
struct stream *s = __sc_strm(cs);
- struct appctx *appctx = __cs_appctx(cs);
+ struct appctx *appctx = __sc_appctx(cs);
struct show_stat_ctx *ctx = appctx->svcctx;
struct proxy *px = NULL;
@@ -4165,7 +4165,7 @@
{
struct stream *s = __sc_strm(cs);
struct uri_auth *uri = s->be->uri_auth;
- struct appctx *appctx = __cs_appctx(cs);
+ struct appctx *appctx = __sc_appctx(cs);
struct show_stat_ctx *ctx = appctx->svcctx;
struct htx_sl *sl;
unsigned int flags;
@@ -4220,7 +4220,7 @@
char scope_txt[STAT_SCOPE_TXT_MAXLEN + sizeof STAT_SCOPE_PATTERN];
struct stream *s = __sc_strm(cs);
struct uri_auth *uri = s->be->uri_auth;
- struct appctx *appctx = __cs_appctx(cs);
+ struct appctx *appctx = __sc_appctx(cs);
struct show_stat_ctx *ctx = appctx->svcctx;
struct htx_sl *sl;
unsigned int flags;
@@ -4550,7 +4550,7 @@
*/
static int stats_dump_info_to_buffer(struct stconn *cs)
{
- struct appctx *appctx = __cs_appctx(cs);
+ struct appctx *appctx = __sc_appctx(cs);
struct show_stat_ctx *ctx = appctx->svcctx;
if (!stats_fill_info(info, INF_TOTAL_FIELDS, ctx->flags))
diff --git a/src/stream.c b/src/stream.c
index e8f9c91..9c10db9 100644
--- a/src/stream.c
+++ b/src/stream.c
@@ -536,7 +536,7 @@
goto out_fail_accept;
/* finish initialization of the accepted file descriptor */
- if (cs_appctx(cs))
+ if (sc_appctx(cs))
cs_want_get(s->scf);
if (sess->fe->accept && sess->fe->accept(s) < 0)
@@ -1002,7 +1002,7 @@
return ACT_RET_ERR;
}
else
- appctx = __cs_appctx(s->scb);
+ appctx = __sc_appctx(s->scb);
if (rule->from != ACT_F_HTTP_REQ) {
if (sess->fe == s->be) /* report it if the request was intercepted by the frontend */
@@ -1542,15 +1542,15 @@
/* stream connectors are processed outside of process_stream() and must be
* handled at the latest moment.
*/
- if (cs_appctx(scf)) {
+ if (sc_appctx(scf)) {
if ((cs_rx_endp_ready(scf) && !cs_rx_blocked(scf)) ||
(cs_tx_endp_ready(scf) && !cs_tx_blocked(scf)))
- appctx_wakeup(__cs_appctx(scf));
+ appctx_wakeup(__sc_appctx(scf));
}
- if (cs_appctx(scb)) {
+ if (sc_appctx(scb)) {
if ((cs_rx_endp_ready(scb) && !cs_rx_blocked(scb)) ||
(cs_tx_endp_ready(scb) && !cs_tx_blocked(scb)))
- appctx_wakeup(__cs_appctx(scb));
+ appctx_wakeup(__sc_appctx(scb));
}
}
@@ -2755,7 +2755,7 @@
scf = s->scf;
cof = sc_conn(scf);
- acf = cs_appctx(scf);
+ acf = sc_appctx(scf);
if (cof && cof->src && addr_to_str(cof->src, pn, sizeof(pn)) >= 0)
src = pn;
else if (acf)
@@ -2763,7 +2763,7 @@
scb = s->scb;
cob = sc_conn(scb);
- acb = cs_appctx(scb);
+ acb = sc_appctx(scb);
srv = objt_server(s->target);
if (srv)
dst = srv->id;
@@ -3152,7 +3152,7 @@
*/
static int stats_dump_full_strm_to_buffer(struct stconn *cs, struct stream *strm)
{
- struct appctx *appctx = __cs_appctx(cs);
+ struct appctx *appctx = __sc_appctx(cs);
struct show_sess_ctx *ctx = appctx->svcctx;
struct stconn *scf, *scb;
struct tm tm;
@@ -3330,7 +3330,7 @@
conn_fd(conn) >= 0 ? fdtab[conn->handle.fd].thread_mask: 0);
}
- else if ((tmpctx = cs_appctx(scf)) != NULL) {
+ else if ((tmpctx = sc_appctx(scf)) != NULL) {
chunk_appendf(&trash,
" app0=%p st0=%d st1=%d st2=%d applet=%s tmask=0x%lx nice=%d calls=%u rate=%u cpu=%llu lat=%llu\n",
tmpctx,
@@ -3369,7 +3369,7 @@
conn_fd(conn) >= 0 ? fdtab[conn->handle.fd].thread_mask: 0);
}
- else if ((tmpctx = cs_appctx(scb)) != NULL) {
+ else if ((tmpctx = sc_appctx(scb)) != NULL) {
chunk_appendf(&trash,
" app1=%p st0=%d st1=%d st2=%d applet=%s tmask=0x%lx nice=%d calls=%u rate=%u cpu=%llu lat=%llu\n",
tmpctx,