From: Aurelien DARRAGON Date: Fri, 17 Nov 2023 17:05:15 +0000 (+0100) Subject: Revert "MINOR: http_htx/errors: prevent the use of some keywords when not in tcp... X-Git-Tag: v2.9-dev10~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=33e5c4055f405f5e1750c82d848eeeeb8a2c405f;p=thirdparty%2Fhaproxy.git Revert "MINOR: http_htx/errors: prevent the use of some keywords when not in tcp/http mode" This reverts commit b41b77b4ccfd71647f469065006310772f4911a3 since we cannot perform the test during parsing as the effective proxy mode is not yet known. --- diff --git a/src/http_htx.c b/src/http_htx.c index 5163b946db..c9d01aac8d 100644 --- a/src/http_htx.c +++ b/src/http_htx.c @@ -2014,12 +2014,6 @@ static int proxy_parse_errorloc(char **args, int section, struct proxy *curpx, goto out; } - if (curpx->mode != PR_MODE_TCP && curpx->mode != PR_MODE_HTTP) { - memprintf(errmsg, "%s : requires TCP or HTTP mode.\n", args[0]); - ret = -1; - goto out; - } - if (*(args[1]) == 0 || *(args[2]) == 0) { memprintf(errmsg, "%s : expects and as arguments.\n", args[0]); ret = -1; @@ -2087,12 +2081,6 @@ static int proxy_parse_errorfile(char **args, int section, struct proxy *curpx, goto out; } - if (curpx->mode != PR_MODE_TCP && curpx->mode != PR_MODE_HTTP) { - memprintf(errmsg, "%s : requires TCP or HTTP mode.\n", args[0]); - ret = -1; - goto out; - } - if (*(args[1]) == 0 || *(args[2]) == 0) { memprintf(errmsg, "%s : expects and as arguments.\n", args[0]); ret = -1; @@ -2156,12 +2144,6 @@ static int proxy_parse_errorfiles(char **args, int section, struct proxy *curpx, goto out; } - if (curpx->mode != PR_MODE_TCP && curpx->mode != PR_MODE_HTTP) { - memprintf(err, "%s : requires TCP or HTTP mode.\n", args[0]); - ret = -1; - goto out; - } - if (!*(args[1])) { memprintf(err, "%s : expects as argument.", args[0]); ret = -1; @@ -2225,11 +2207,6 @@ static int proxy_parse_http_error(char **args, int section, struct proxy *curpx, goto out; } - if (curpx->mode != PR_MODE_TCP && curpx->mode != PR_MODE_HTTP) { - memprintf(errmsg, "%s : requires TCP or HTTP mode.\n", args[0]); - goto error; - } - cur_arg = 1; curpx->conf.args.ctx = ARGC_HERR; reply = http_parse_http_reply((const char **)args, &cur_arg, curpx, 0, errmsg);