From 760fef1fc00d1eaa18fd1f43e38d72dc2133bea7 Mon Sep 17 00:00:00 2001 From: Tim Duesterhus Date: Fri, 20 Feb 2026 12:20:05 +0100 Subject: [PATCH] BUG/MINOR: tcpcheck: Fix typo in error error message for `http-check expect` With a config: backend bk_app http-check expect status 200 string "status: ok" This now correctly emits the error: config : parsing [./patch.cfg:2] : 'http-check expect' : only one pattern expected. This line containing the typo is unchanged since at least HAProxy 2.2, the patch should be backported into all supported branches. --- src/tcpcheck.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/tcpcheck.c b/src/tcpcheck.c index 3d99dfd2a..86c798e73 100644 --- a/src/tcpcheck.c +++ b/src/tcpcheck.c @@ -3262,7 +3262,7 @@ struct tcpcheck_rule *parse_tcpcheck_expect(char **args, int cur_arg, struct pro } else if (strcmp(args[cur_arg], "string") == 0 || strcmp(args[cur_arg], "rstring") == 0) { if (type != TCPCHK_EXPECT_UNDEF) { - memprintf(errmsg, "only on pattern expected"); + memprintf(errmsg, "only one pattern expected"); goto error; } if (proto != TCPCHK_RULES_HTTP_CHK) @@ -3281,7 +3281,7 @@ struct tcpcheck_rule *parse_tcpcheck_expect(char **args, int cur_arg, struct pro if (proto == TCPCHK_RULES_HTTP_CHK) goto bad_http_kw; if (type != TCPCHK_EXPECT_UNDEF) { - memprintf(errmsg, "only on pattern expected"); + memprintf(errmsg, "only one pattern expected"); goto error; } type = ((*(args[cur_arg]) == 'b') ? TCPCHK_EXPECT_BINARY : TCPCHK_EXPECT_BINARY_REGEX); @@ -3295,7 +3295,7 @@ struct tcpcheck_rule *parse_tcpcheck_expect(char **args, int cur_arg, struct pro } else if (strcmp(args[cur_arg], "string-lf") == 0 || strcmp(args[cur_arg], "binary-lf") == 0) { if (type != TCPCHK_EXPECT_UNDEF) { - memprintf(errmsg, "only on pattern expected"); + memprintf(errmsg, "only one pattern expected"); goto error; } if (proto != TCPCHK_RULES_HTTP_CHK) @@ -3317,7 +3317,7 @@ struct tcpcheck_rule *parse_tcpcheck_expect(char **args, int cur_arg, struct pro if (proto != TCPCHK_RULES_HTTP_CHK) goto bad_tcp_kw; if (type != TCPCHK_EXPECT_UNDEF) { - memprintf(errmsg, "only on pattern expected"); + memprintf(errmsg, "only one pattern expected"); goto error; } type = ((*(args[cur_arg]) == 's') ? TCPCHK_EXPECT_HTTP_STATUS : TCPCHK_EXPECT_HTTP_STATUS_REGEX); @@ -3335,7 +3335,7 @@ struct tcpcheck_rule *parse_tcpcheck_expect(char **args, int cur_arg, struct pro goto error; } if (type != TCPCHK_EXPECT_UNDEF) { - memprintf(errmsg, "only on pattern expected"); + memprintf(errmsg, "only one pattern expected"); goto error; } type = TCPCHK_EXPECT_CUSTOM; @@ -3346,7 +3346,7 @@ struct tcpcheck_rule *parse_tcpcheck_expect(char **args, int cur_arg, struct pro if (proto != TCPCHK_RULES_HTTP_CHK) goto bad_tcp_kw; if (type != TCPCHK_EXPECT_UNDEF) { - memprintf(errmsg, "only on pattern expected"); + memprintf(errmsg, "only one pattern expected"); goto error; } type = TCPCHK_EXPECT_HTTP_HEADER;