mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-10 17:17:06 +02:00
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:
parent
db933d6fdd
commit
12d5228a44
@ -2766,12 +2766,6 @@ static int cli_io_handler_dump_resolvers_to_buffer(struct appctx *appctx)
|
|||||||
|
|
||||||
chunk_reset(&trash);
|
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 (LIST_ISEMPTY(&sec_resolvers)) {
|
||||||
if (ci_putstr(cs_ic(cs), "No resolvers found\n") == -1)
|
if (ci_putstr(cs_ic(cs), "No resolvers found\n") == -1)
|
||||||
goto full;
|
goto full;
|
||||||
@ -2827,12 +2821,8 @@ static int cli_io_handler_dump_resolvers_to_buffer(struct appctx *appctx)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* fall through */
|
/* done! */
|
||||||
|
|
||||||
default:
|
|
||||||
appctx->st2 = STAT_ST_FIN;
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
|
||||||
full:
|
full:
|
||||||
/* the output buffer is full, retry later */
|
/* the output buffer is full, retry later */
|
||||||
cs_rx_room_blk(cs);
|
cs_rx_room_blk(cs);
|
||||||
|
Loading…
Reference in New Issue
Block a user