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.
This commit is contained in:
Olivier Houchard 2026-04-22 18:21:05 +02:00 committed by Willy Tarreau
parent dbf471f99a
commit 915a58c3c1

View 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]);