]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: cli: remove assignments to st0 and st2 in keyword parsers
authorWilly Tarreau <w@1wt.eu>
Thu, 24 Nov 2016 15:45:53 +0000 (16:45 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 24 Nov 2016 15:59:28 +0000 (16:59 +0100)
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
src/dns.c
src/map.c
src/proto_http.c
src/ssl_sock.c
src/stats.c
src/stick_table.c
src/stream.c

index 5ae8959b3195bd1a885b96fb479b09db87cb22b6..239a505ad97a0cf3309c586c300c383ca39f3c4a 100644 (file)
--- 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]);
index e29c3e4bf57266c5d925e131acca71dee7522c52..1e286ff08c3f946649f745b5019db858ca9f026e 100644 (file)
--- 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.
index 71d480c5c3041dd92981c559cc2571e3327b294a..b6fce4df84b333b5e04854dd3cc5648635c69275 100644 (file)
--- 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;
        }
index a792fcf411fe324b8a88e8cf22587a1badf9d78e..cc07f01ef81c51ba1c013e3ce2dc09657caa34a4 100644 (file)
@@ -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;
 }
 
index cf2f855267097042013d3af31f1f5e5fe108d28b..8429324a4144397184e886b482ed73efaf55fa25 100644 (file)
@@ -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;
 }
index 64be56c65a651e92978b84b7d67a32b2035e51d9..1d5b39c271f9c2fea2da2bb35f2b464ab72063b4 100644 (file)
@@ -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;
 }
 
index 29017d901c44d7f74cd550ed3e79d04d9dc505eb..c6d45cafc15b26b8174e703bd501600e89bc495c 100644 (file)
@@ -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;
index 8ed3047d75ef726c1efd0e7c880d7d3ead35d716..21d12e7e10632804ab3220ae58ecff5cc770c919 100644 (file)
@@ -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;