]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
Revert "MINOR: tcp_rules: tcp-{request,response} requires TCP or HTTP mode"
authorAurelien DARRAGON <adarragon@haproxy.com>
Fri, 17 Nov 2023 17:00:26 +0000 (18:00 +0100)
committerWilly Tarreau <w@1wt.eu>
Sat, 18 Nov 2023 10:16:21 +0000 (11:16 +0100)
This reverts commit 09b15e4163b6a32a418b6f8b8e29dfb356d5fee6 since
we cannot perform the test during parsing as the effective proxy mode is
not yet known.

src/tcp_rules.c

index 31b36ad7512e1dd276f12a340090a01594fca960..c7bdddccaad6250a4cda809b1b3a46d64cc3a770 100644 (file)
@@ -1105,12 +1105,6 @@ static int tcp_parse_tcp_rep(char **args, int section_type, struct proxy *curpx,
                return -1;
        }
 
-       if (curpx->mode != PR_MODE_TCP && curpx->mode != PR_MODE_HTTP) {
-               memprintf(err, "%s %s is not allowed because %s %s is not in TCP or HTTP mode",
-                         args[0], args[1], proxy_type_str(curpx), curpx->id);
-               return -1;
-       }
-
        if (strcmp(args[1], "inspect-delay") == 0) {
                if ((curpx == defpx && strlen(defpx->id) == 0) || !(curpx->cap & PR_CAP_BE)) {
                        memprintf(err, "%s %s is only allowed in 'backend' sections or 'defaults' section with a name",
@@ -1228,12 +1222,6 @@ static int tcp_parse_tcp_req(char **args, int section_type, struct proxy *curpx,
                return -1;
        }
 
-       if (curpx->mode != PR_MODE_TCP && curpx->mode != PR_MODE_HTTP) {
-               memprintf(err, "%s %s is not allowed because %s %s is not in TCP or HTTP mode",
-                         args[0], args[1], proxy_type_str(curpx), curpx->id);
-               return -1;
-       }
-
        if (strcmp(args[1], "inspect-delay") == 0) {
                if (curpx == defpx && strlen(defpx->id) == 0) {
                        memprintf(err, "%s %s is not allowed in anonymous 'defaults' sections",