From: Christopher Faulet Date: Wed, 9 Dec 2020 18:45:07 +0000 (+0100) Subject: BUG/MINOR: http-check: Use right condition to consider HTX message as full X-Git-Tag: v2.4-dev3~23 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3f527197cd7d34fc1975862f346e2d778dc44dc2;p=thirdparty%2Fhaproxy.git 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. --- diff --git a/src/tcpcheck.c b/src/tcpcheck.c index daacc37d6a..513170ae62 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;