]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: action: add a new ACT_F_CLI_PARSER origin designation
authorWilly Tarreau <w@1wt.eu>
Fri, 26 Mar 2021 14:36:44 +0000 (15:36 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 26 Mar 2021 15:34:53 +0000 (16:34 +0100)
In order to process samples from the command line interface we'll need
rules as well, and these rules will have to be marked as coming from
the CLI parser. This new origin is used for this.

include/haproxy/action-t.h
src/vars.c

index 77097773f23d58a55c4ff3de8d2fb46604c6cbd5..9009e4aae84dd4a5b91cf3a2fb94366673e63e6d 100644 (file)
@@ -35,6 +35,7 @@ enum act_from {
        ACT_F_HTTP_RES,    /* http-response */
        ACT_F_TCP_CHK,     /* tcp-check. */
        ACT_F_CFG_PARSER,  /* config parser */
+       ACT_F_CLI_PARSER,  /* command line parser */
 };
 
 enum act_return {
index 5c8d45e39e324ba53db3901be1fe5fe77dff985c..9be070b71f0b7a861c467949d64f90371e8c3361 100644 (file)
@@ -654,6 +654,7 @@ static enum act_return action_store(struct act_rule *rule, struct proxy *px,
        case ACT_F_HTTP_RES:    dir = SMP_OPT_DIR_RES; break;
        case ACT_F_TCP_CHK:     dir = SMP_OPT_DIR_REQ; break;
        case ACT_F_CFG_PARSER:  dir = SMP_OPT_DIR_REQ;  break; /* not used anyway */
+       case ACT_F_CLI_PARSER:  dir = SMP_OPT_DIR_REQ;  break; /* not used anyway */
        default:
                send_log(px, LOG_ERR, "Vars: internal error while execute action store.");
                if (!(global.mode & MODE_QUIET) || (global.mode & MODE_VERBOSE))
@@ -780,6 +781,7 @@ static enum act_parse_ret parse_store(const char **args, int *arg, struct proxy
        case ACT_F_HTTP_RES:    flags = SMP_VAL_BE_HRS_HDR; break;
        case ACT_F_TCP_CHK:     flags = SMP_VAL_BE_CHK_RUL; break;
        case ACT_F_CFG_PARSER:  flags = SMP_VAL_CFG_PARSER; break;
+       case ACT_F_CLI_PARSER:  flags = SMP_VAL_CLI_PARSER; break;
        default:
                memprintf(err,
                          "internal error, unexpected rule->from=%d, please report this bug!",