From 30e5e18bbbfa5e1b38a29a139a782e637318705d Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Thu, 24 Nov 2016 16:45:53 +0100 Subject: [PATCH] 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. --- src/cli.c | 1 - src/dns.c | 3 --- src/map.c | 4 ---- src/proto_http.c | 1 - src/ssl_sock.c | 7 +------ src/stats.c | 2 -- src/stick_table.c | 1 - src/stream.c | 1 - 8 files changed, 1 insertion(+), 19 deletions(-) diff --git a/src/cli.c b/src/cli.c index 5ae8959b3..239a505ad 100644 --- a/src/cli.c +++ b/src/cli.c @@ -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]); diff --git a/src/dns.c b/src/dns.c index e29c3e4bf..1e286ff08 100644 --- a/src/dns.c +++ b/src/dns.c @@ -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. diff --git a/src/map.c b/src/map.c index 71d480c5c..b6fce4df8 100644 --- a/src/map.c +++ b/src/map.c @@ -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; } diff --git a/src/proto_http.c b/src/proto_http.c index a792fcf41..cc07f01ef 100644 --- a/src/proto_http.c +++ b/src/proto_http.c @@ -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; } diff --git a/src/ssl_sock.c b/src/ssl_sock.c index cf2f85526..8429324a4 100644 --- a/src/ssl_sock.c +++ b/src/ssl_sock.c @@ -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; } diff --git a/src/stats.c b/src/stats.c index 64be56c65..1d5b39c27 100644 --- a/src/stats.c +++ b/src/stats.c @@ -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; } diff --git a/src/stick_table.c b/src/stick_table.c index 29017d901..c6d45cafc 100644 --- a/src/stick_table.c +++ b/src/stick_table.c @@ -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; diff --git a/src/stream.c b/src/stream.c index 8ed3047d7..21d12e7e1 100644 --- a/src/stream.c +++ b/src/stream.c @@ -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; -- 2.47.3