From: Olivier Houchard Date: Wed, 22 Apr 2026 16:21:05 +0000 (+0200) Subject: BUG/MINOR: h2: make tune.h2.log-errors actually work X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=915a58c3c1f1967e52867f87a018d5cc0fabe8de;p=thirdparty%2Fhaproxy.git BUG/MINOR: h2: make tune.h2.log-errors actually work 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. --- diff --git a/src/mux_h2.c b/src/mux_h2.c index 473e18097..ba12a543d 100644 --- a/src/mux_h2.c +++ b/src/mux_h2.c @@ -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]);