CLEANUP: resolvers/cli: remove the unneeded appctx->st2 from "show resolvers"

The command uses this state but _INIT immediately turns to _LIST, which
turns to _FIN at the end without doing anything in that state, thus the
only existing state is _LIST so we don't need to store a state. Let's
just get rid of it.
This commit is contained in:
Willy Tarreau 2022-05-05 16:38:13 +02:00
parent db933d6fdd
commit 12d5228a44

View File

@ -2766,12 +2766,6 @@ static int cli_io_handler_dump_resolvers_to_buffer(struct appctx *appctx)
chunk_reset(&trash);
switch (appctx->st2) {
case STAT_ST_INIT:
appctx->st2 = STAT_ST_LIST; /* let's start producing data */
/* fall through */
case STAT_ST_LIST:
if (LIST_ISEMPTY(&sec_resolvers)) {
if (ci_putstr(cs_ic(cs), "No resolvers found\n") == -1)
goto full;
@ -2827,12 +2821,8 @@ static int cli_io_handler_dump_resolvers_to_buffer(struct appctx *appctx)
}
}
/* fall through */
default:
appctx->st2 = STAT_ST_FIN;
/* done! */
return 1;
}
full:
/* the output buffer is full, retry later */
cs_rx_room_blk(cs);