From: Willy Tarreau Date: Thu, 2 Sep 2021 17:43:20 +0000 (+0200) Subject: MINOR: sample: add missing ARGC_ entries X-Git-Tag: v2.5-dev6~15 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=57467b83565b9c3e112053c92ede66113809d458;p=thirdparty%2Fhaproxy.git MINOR: sample: add missing ARGC_ entries For a long time we couldn't have arguments in expressions used in tcp-request, tcp-response etc rules. But now due to the variables it's possible, and their context in case of failure to resolve an argument (e.g. backend name not found) is not properly reported because there is no arg context values in ARGC_* to report them. Let's add a number of missing ones for tcp-request {connection, session,content}, tcp-response content, tcp-check, the config parser (for "set-var" in the global section) and the CLI parser (for "set-var" on the CLI). --- diff --git a/include/haproxy/arg-t.h b/include/haproxy/arg-t.h index cb94ef7ea1..57b4080ca6 100644 --- a/include/haproxy/arg-t.h +++ b/include/haproxy/arg-t.h @@ -83,6 +83,13 @@ enum { ARGC_USRV, /* use-server message */ ARGC_HERR, /* http-error */ ARGC_OT, /* opentracing scope args */ + ARGC_TCO, /* tcp-request connection expression */ + ARGC_TSE, /* tcp-request session expression */ + ARGC_TRQ, /* tcp-request content expression */ + ARGC_TRS, /* tcp-response content expression */ + ARGC_TCK, /* tcp-check expression */ + ARGC_CFG, /* configuration expression */ + ARGC_CLI, /* CLI expression*/ }; /* flags used when compiling and executing regex */ diff --git a/src/sample.c b/src/sample.c index b9d90ea0ec..a0727d2360 100644 --- a/src/sample.c +++ b/src/sample.c @@ -1160,8 +1160,8 @@ int smp_resolve_args(struct proxy *p, char **err) case ARGC_TRK: where = "in tracking rule in"; break; case ARGC_LOG: where = "in log-format string in"; break; case ARGC_LOGSD: where = "in log-format-sd string in"; break; - case ARGC_HRQ: where = "in http-request header format string in"; break; - case ARGC_HRS: where = "in http-response header format string in"; break; + case ARGC_HRQ: where = "in http-request expression in"; break; + case ARGC_HRS: where = "in http-response response in"; break; case ARGC_UIF: where = "in unique-id-format string in"; break; case ARGC_RDR: where = "in redirect format string in"; break; case ARGC_CAP: where = "in capture rule in"; break; @@ -1170,6 +1170,13 @@ int smp_resolve_args(struct proxy *p, char **err) case ARGC_SPOE: where = "in spoe-message directive in"; break; case ARGC_HERR: where = "in http-error directive in"; break; case ARGC_OT: where = "in ot-scope directive in"; break; + case ARGC_TCO: where = "in tcp-request connection expression in"; break; + case ARGC_TSE: where = "in tcp-request session expression in"; break; + case ARGC_TRQ: where = "in tcp-request content expression in"; break; + case ARGC_TRS: where = "in tcp-response content expression in"; break; + case ARGC_TCK: where = "in tcp-check expression in"; break; + case ARGC_CFG: where = "in configuration expression in"; break; + case ARGC_CLI: where = "in CLI expression in"; break; } /* set a few default settings */