mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-02-13 00:48:18 +00:00
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.
This commit is contained in:
parent
a202d1d4c1
commit
b2c2e0fcca
@ -171,7 +171,6 @@ struct check {
|
||||
int send_proxy; /* send a PROXY protocol header with checks */
|
||||
struct list *tcpcheck_rules; /* tcp-check send / expect rules */
|
||||
struct tcpcheck_rule *current_step; /* current step when using tcpcheck */
|
||||
struct tcpcheck_rule *last_started_step;/* pointer to latest tcpcheck rule started */
|
||||
int inter, fastinter, downinter; /* checks: time in milliseconds */
|
||||
enum chk_result result; /* health-check result : CHK_RES_* */
|
||||
int state; /* state of the check : CHK_ST_* */
|
||||
|
1097
src/checks.c
1097
src/checks.c
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user