]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: h2: make tune.h2.log-errors actually work
authorOlivier Houchard <ohouchard@haproxy.com>
Wed, 22 Apr 2026 16:21:05 +0000 (18:21 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 23 Apr 2026 06:04:43 +0000 (08:04 +0200)
Commit e67e36c9eb35eb1477ae0e425a660ee0c631cecd introduced
tune.h2.log-errors, that would let you pick if you wanted to know about
stream errors, connection errors, or no error.
However, a logic error made it so no error will be picked for any value
except for "none", in which case connection would be picked. Fix that by
just checking the strcmp() return value correctly.

This should be backported wherever e67e36c9eb35eb1477ae0e425a660ee0c631cecd
has been backported.

src/mux_h2.c

index 473e1809757d970da3648fa9990b1c6fb237e43b..ba12a543def4aeaa89f97d09747288dcd4a04146 100644 (file)
@@ -8738,11 +8738,11 @@ static int h2_parse_log_errors(char **args, int section_type, struct proxy *curp
 
        /* backend/frontend/default */
        vptr = &h2_settings_log_errors;
-       if (strcmp(args[1], "none"))
+       if (strcmp(args[1], "none") == 0)
                *vptr = H2_ERR_LOG_ERR_NONE;
-       else if (strcmp(args[1], "connection"))
+       else if (strcmp(args[1], "connection") == 0)
                *vptr = H2_ERR_LOG_ERR_CONN;
-       else if (strcmp(args[1], "stream"))
+       else if (strcmp(args[1], "stream") == 0)
                *vptr = H2_ERR_LOG_ERR_STRM;
        else {
                memprintf(err, "'%s' expects 'none', 'connection', or 'stream'", args[0]);