]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLENAUP: cfgparse: accept-invalid-http-* does not support "no"/"defaults"
authorWilly Tarreau <w@1wt.eu>
Mon, 23 Feb 2026 14:42:04 +0000 (15:42 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 23 Feb 2026 14:44:40 +0000 (15:44 +0100)
Some options do not support "no" nor "defaults" and they're placed after
the check for their absence. However, "accept-invalid-http-request" and
"accept-invalid-http-response" still used to check for the flags that
come with these prefixes, but Coverity noticed this was dead code in
github issue #3272. Let's just drop the test.

No backport needed as it's just dead code.

src/cfgparse-listen.c

index 3bce9dd0b39e0d1f4b35ac6b16f09d0362e067b0..12d42782e83e45bdad17ba0485a4ed386024e0f4 100644 (file)
@@ -2454,18 +2454,7 @@ stats_error_parsing:
                        }
 
                        curproxy->no_options2 &= ~val;
-                       curproxy->options2    &= ~val;
-
-                       switch (kwm) {
-                       case KWM_STD:
-                               curproxy->options2 |= val;
-                               break;
-                       case KWM_NO:
-                               curproxy->no_options2 |= val;
-                               break;
-                       case KWM_DEF: /* already cleared */
-                               break;
-                       }
+                       curproxy->options2    |= val;
 
                        err_code |= ERR_WARN;
                        goto out;