]> git.kaiwu.me - haproxy.git/commitdiff
MINOR: tcpcheck: add TCPCHK_EXPT_FL_ALLOW_EMPTY flag on expect rules
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 17 Nov 2026 14:27:35 +0000 (15:27 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Mon, 23 Nov 2026 13:50:40 +0000 (14:50 +0100)
Custom expect functions are not evaluated when the response buffer is
empty. With the new TCPCHK_EXPT_FL_ALLOW_EMPTY flag, a custom expect
rule can be evaluated with an empty response, on the condition the
custom function properly handles this situation. It is useful when
the connection closure by the server is itself a valid result.

include/haproxy/tcpcheck-t.h

index 785b88ec6ec61482c4f15d5404244b97a73a3a30..c97688eaeaf0420f111c38af46f62952bcf04432 100644 (file)
@@ -91,6 +91,7 @@ enum tcpcheck_expect_type {
 #define TCPCHK_EXPT_FL_HTTP_HVAL_REG   0x1000 /* Regex match on the HTTP header value*/
 #define TCPCHK_EXPT_FL_HTTP_HVAL_FMT   0x2000 /* The HTTP header value is a log-format string */
 #define TCPCHK_EXPT_FL_HTTP_HVAL_FULL  0x4000 /* Match the full header value ( no stop on commas ) */
+#define TCPCHK_EXPT_FL_ALLOW_EMPTY     0x8000 /* Custom expect function also handles an empty response */
 
 #define TCPCHK_EXPT_FL_HTTP_HNAME_TYPE 0x003E /* Mask to get matching method on header name */
 #define TCPCHK_EXPT_FL_HTTP_HVAL_TYPE  0x1F00 /* Mask to get matching method on header value */