MINOR: appctx/cli: remove the cli_socket entry from the appctx union
This one now migrates to the general purpose cli.p0.
diff --git a/include/types/applet.h b/include/types/applet.h
index 672f9db..62537a8 100644
--- a/include/types/applet.h
+++ b/include/types/applet.h
@@ -168,7 +168,6 @@
struct {
char **var;
} env;
- struct list *cli_socket; /* pointer to the latest dumped CLI socket in the list */
/* NOTE: please add regular applet contexts (ie: not
* CLI-specific ones) above, before "cli".
*/
diff --git a/src/cli.c b/src/cli.c
index adb2dd6..c84d72f 100644
--- a/src/cli.c
+++ b/src/cli.c
@@ -729,7 +729,8 @@
}
/*
- * CLI IO handler for `show cli sockets`
+ * CLI IO handler for `show cli sockets`.
+ * Uses ctx.cli.p0 to store the restart pointer.
*/
static int cli_io_handler_show_cli_sock(struct appctx *appctx)
{
@@ -745,7 +746,6 @@
si_applet_cant_put(si);
return 0;
}
- appctx->ctx.cli_socket = NULL;
appctx->st2 = STAT_ST_LIST;
case STAT_ST_LIST:
@@ -754,15 +754,14 @@
struct listener *l;
/*
- * get the latest dumped node in appctx->ctx.cli_socket
+ * get the latest dumped node in appctx->ctx.cli.p0
* if the current node is the first of the list
*/
- if (appctx->ctx.cli_socket &&
- &bind_conf->by_fe == (&global.stats_fe->conf.bind)->n
- ) {
+ if (appctx->ctx.cli.p0 &&
+ &bind_conf->by_fe == (&global.stats_fe->conf.bind)->n) {
/* change the current node to the latest dumped and continue the loop */
- bind_conf = LIST_ELEM(appctx->ctx.cli_socket, typeof(bind_conf), by_fe);
+ bind_conf = LIST_ELEM(appctx->ctx.cli.p0, typeof(bind_conf), by_fe);
continue;
}
@@ -815,7 +814,7 @@
return 0;
}
}
- appctx->ctx.cli_socket = &bind_conf->by_fe; /* store the latest list node dumped */
+ appctx->ctx.cli.p0 = &bind_conf->by_fe; /* store the latest list node dumped */
}
}
default: