From 3f527197cd7d34fc1975862f346e2d778dc44dc2 Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Wed, 9 Dec 2020 19:45:07 +0100 Subject: [PATCH] BUG/MINOR: http-check: Use right condition to consider HTX message as full When an HTTP expect rule is evaluated, we must know if more data is expected or not to wait if the matching fails. If the whole response is received or if the HTX message is full, we must not wait. In this context, htx_free_data_space() must be used instead of htx_free_space(). The fisrt one count down the block size. Otherwise at the edge, when only the block size remains free (8 bytes), we may think there is some place for more data while the mux is unable to add more block. This bug explains the loop described on the GH issue #991. It should be backported as far as 2.2. --- src/tcpcheck.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tcpcheck.c b/src/tcpcheck.c index daacc37d6..513170ae6 100644 --- a/src/tcpcheck.c +++ b/src/tcpcheck.c @@ -1511,7 +1511,7 @@ enum tcpcheck_eval_ret tcpcheck_eval_expect_http(struct check *check, struct tcp struct ist desc = IST_NULL; int i, match, inverse; - last_read |= (!htx_free_space(htx) || (htx_get_tail_type(htx) == HTX_BLK_EOM)); + last_read |= (!htx_free_data_space(htx) || (htx_get_tail_type(htx) == HTX_BLK_EOM)); if (htx->flags & HTX_FL_PARSING_ERROR) { status = HCHK_STATUS_L7RSP;