]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MAJOR: checks: Refactor and simplify the tcp-check loop
authorChristopher Faulet <cfaulet@haproxy.com>
Mon, 30 Mar 2020 09:05:10 +0000 (11:05 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Mon, 27 Apr 2020 07:39:37 +0000 (09:39 +0200)
commitb2c2e0fcca09acc6e6527cb5d90a18a9674e7a78
treeee809fb4ac920ea7756215f3312ad4847a1e8296
parenta202d1d4c1d73032f01bd7ccf438c5468347cffd
MAJOR: checks: Refactor and simplify the tcp-check loop

The loop in tcpcheck_main() function is quite hard to understand. Depending
where we are in the loop, The current_step is the currentely executed rule or
the one to execute on the next call to tcpcheck_main(). When the check result is
reported, we rely on the rule pointed by last_started_step or the one pointed by
current_step. In addition, the loop does not use the common list_for_each_entry
macro and it is thus quite confusing.

So the loop has been totally rewritten and splitted to several functions to
simplify its reading and its understanding. Tcp-check rules are evaluated in
dedicated functions. And a common for_each loop is used and only one rule is
referenced, the current one.
include/types/checks.h
src/checks.c