]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: http-check: Use right condition to consider HTX message as full
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 9 Dec 2020 18:45:07 +0000 (19:45 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 11 Dec 2020 10:48:15 +0000 (11:48 +0100)
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

index daacc37d6af96d433d2756344e47ec0e65582bf9..513170ae628cf0b03dc9f6f146d7ce96b79ffc3e 100644 (file)
@@ -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;