]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: checks: chained expect will not properly wait for enough data
authorGaetan Rivet <grive@u256.net>
Thu, 13 Feb 2020 09:30:01 +0000 (10:30 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Mon, 27 Apr 2020 07:39:37 +0000 (09:39 +0200)
commit738ee76aa7a9968cb9c9610725c26622c50f0b33
tree663aed1d9f7d4bfa54fd79632e3fa943a9552cb7
parent31c30fdf1ea82cde9544ceab9cdff71ab1bb200a
BUG/MINOR: checks: chained expect will not properly wait for enough data

TCP check expect matching strings or binary patterns are able to know
prior to applying their match function whether the available data is
already sufficient to attempt the match or not.

As such, on insufficient data the expect is postponed. This behavior
avoids unnecessary matches when the data could not possibly match.

When chaining expect, upon passing the previous and going onto the next
however, this length check is not done again. Then the match is done and
will necessarily fail, triggering a new wait for more data. The end
result is the same for a slightly higher cost.

Check received data length for all expects in a chain.

This bug exists since the introduction of the feature:
Fixes: 5ecb77f4c76f ("MEDIUM: checks: add send/expect tcp based check")
Version 1.5+ impacted.
src/checks.c