From: Willy Tarreau Date: Thu, 24 Nov 2016 15:45:53 +0000 (+0100) Subject: CLEANUP: cli: remove assignments to st0 and st2 in keyword parsers X-Git-Tag: v1.7.0~28 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=30e5e18bbbfa5e1b38a29a139a782e637318705d;p=thirdparty%2Fhaproxy.git 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. --- diff --git a/src/cli.c b/src/cli.c index 5ae8959b31..239a505ad9 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 e29c3e4bf5..1e286ff08c 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 71d480c5c3..b6fce4df84 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 a792fcf411..cc07f01ef8 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 cf2f855267..8429324a41 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 64be56c65a..1d5b39c271 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 29017d901c..c6d45cafc1 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 8ed3047d75..21d12e7e10 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;