Hi

Please find the attached patch.

Best regards

-- 
Tim Düsterhus
Senior Software Engineer
Tideways GmbH
Königswinterer Str. 116
53227 Bonn
https://tideways.com/imprint
Sitz der Gesellschaft: Bonn
Geschäftsführer: Benjamin Außenhofer (geb. Eberlei)
Registergericht: Amtsgericht Bonn, HRB 22127
From 83c6a76fdfe07dc57a08d14cc589c2d28eb9c22e Mon Sep 17 00:00:00 2001
From: Tim Duesterhus <[email protected]>
Date: Fri, 20 Feb 2026 12:20:05 +0100
Subject: [PATCH] BUG/MINOR: tcpcheck: Fix typo in error error message for
 `http-check expect`
To: [email protected]
Cc: [email protected]

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;
-- 
2.43.0

Reply via email to