From: Christopher Faulet Date: Tue, 17 Nov 2026 14:27:35 +0000 (+0100) Subject: MINOR: tcpcheck: add TCPCHK_EXPT_FL_ALLOW_EMPTY flag on expect rules X-Git-Url: https://git.kaiwu.me/http/%22../static/%7B@url%7D?a=commitdiff_plain;h=d1880eefdb5f861ff86a1da1882c69c54e30c116;p=haproxy.git MINOR: tcpcheck: add TCPCHK_EXPT_FL_ALLOW_EMPTY flag on expect rules 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. --- diff --git a/include/haproxy/tcpcheck-t.h b/include/haproxy/tcpcheck-t.h index 785b88ec6..c97688eae 100644 --- a/include/haproxy/tcpcheck-t.h +++ b/include/haproxy/tcpcheck-t.h @@ -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 */