mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-06 23:27:04 +02:00
CLEANUP: cli: remove assignments to st0 and st2 in keyword parsers
Now it's not needed anymore to set STAT_ST_INIT nor CLI_ST_CALLBACK in the parsers, remove it in the various places.
This commit is contained in:
parent
419085656b
commit
30e5e18bbb
@ -729,7 +729,6 @@ static int cli_parse_show_env(char **args, struct appctx *appctx, void *private)
|
||||
return 1;
|
||||
|
||||
appctx->ctx.env.var = environ;
|
||||
appctx->st2 = STAT_ST_INIT;
|
||||
|
||||
if (*args[2]) {
|
||||
int len = strlen(args[2]);
|
||||
|
@ -1286,10 +1286,7 @@ static int cli_parse_stat_resolvers(char **args, struct appctx *appctx, void *pr
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
appctx->st2 = STAT_ST_INIT;
|
||||
return 1;
|
||||
|
||||
}
|
||||
|
||||
/* This function dumps counters from all resolvers section and associated name servers.
|
||||
|
@ -597,8 +597,6 @@ static int cli_parse_show_map(char **args, struct appctx *appctx, void *private)
|
||||
|
||||
/* no parameter: display all map available */
|
||||
if (!*args[2]) {
|
||||
appctx->st2 = STAT_ST_INIT;
|
||||
appctx->st0 = CLI_ST_CALLBACK;
|
||||
appctx->io_handler = cli_io_handler_pats_list;
|
||||
return 0;
|
||||
}
|
||||
@ -614,8 +612,6 @@ static int cli_parse_show_map(char **args, struct appctx *appctx, void *private)
|
||||
appctx->st0 = CLI_ST_PRINT;
|
||||
return 1;
|
||||
}
|
||||
appctx->st2 = STAT_ST_INIT;
|
||||
appctx->st0 = CLI_ST_CALLBACK;
|
||||
appctx->io_handler = cli_io_handler_pat_list;
|
||||
return 0;
|
||||
}
|
||||
|
@ -12839,7 +12839,6 @@ static int cli_parse_show_errors(char **args, struct appctx *appctx, void *priva
|
||||
else
|
||||
appctx->ctx.errors.iid = -1;
|
||||
appctx->ctx.errors.px = NULL;
|
||||
appctx->st2 = STAT_ST_INIT;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -6139,10 +6139,7 @@ static int cli_parse_show_tlskeys(char **args, struct appctx *appctx, void *priv
|
||||
/* no parameter, shows only file list */
|
||||
if (!*args[2]) {
|
||||
appctx->ctx.tlskeys.dump_all = 1;
|
||||
appctx->st2 = STAT_ST_INIT;
|
||||
appctx->st0 = CLI_ST_CALLBACK;
|
||||
appctx->io_handler = cli_io_handler_tlskeys_files;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -6152,14 +6149,12 @@ static int cli_parse_show_tlskeys(char **args, struct appctx *appctx, void *priv
|
||||
appctx->ctx.tlskeys.dump_all = 1;
|
||||
} else {
|
||||
appctx->ctx.tlskeys.ref = tlskeys_ref_lookup_ref(args[2]);
|
||||
if(!appctx->ctx.tlskeys.ref) {
|
||||
if (!appctx->ctx.tlskeys.ref) {
|
||||
appctx->ctx.cli.msg = "'show tls-keys' unable to locate referenced filename\n";
|
||||
appctx->st0 = CLI_ST_PRINT;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
appctx->st2 = STAT_ST_INIT;
|
||||
appctx->st0 = CLI_ST_CALLBACK;
|
||||
appctx->io_handler = cli_io_handler_tlskeys_entries;
|
||||
return 1;
|
||||
}
|
||||
|
@ -3096,7 +3096,6 @@ static int cli_parse_show_info(char **args, struct appctx *appctx, void *private
|
||||
{
|
||||
if (strcmp(args[2], "typed") == 0)
|
||||
appctx->ctx.stats.flags |= STAT_FMT_TYPED;
|
||||
appctx->st2 = STAT_ST_INIT;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -3114,7 +3113,6 @@ static int cli_parse_show_stat(char **args, struct appctx *appctx, void *private
|
||||
else if (strcmp(args[2], "typed") == 0)
|
||||
appctx->ctx.stats.flags |= STAT_FMT_TYPED;
|
||||
|
||||
appctx->st2 = STAT_ST_INIT;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1861,7 +1861,6 @@ static int cli_parse_table_req(char **args, struct appctx *appctx, void *private
|
||||
|
||||
appctx->private = private;
|
||||
appctx->ctx.table.data_type = -1;
|
||||
appctx->st2 = STAT_ST_INIT;
|
||||
appctx->ctx.table.target = NULL;
|
||||
appctx->ctx.table.proxy = NULL;
|
||||
appctx->ctx.table.entry = NULL;
|
||||
|
@ -3671,7 +3671,6 @@ static int stats_dump_full_strm_to_buffer(struct stream_interface *si, struct st
|
||||
|
||||
static int cli_parse_show_sess(char **args, struct appctx *appctx, void *private)
|
||||
{
|
||||
appctx->st2 = STAT_ST_INIT;
|
||||
if (!cli_has_level(appctx, ACCESS_LVL_OPER))
|
||||
return 1;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user