]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: server: Refactor apply_server_state() to make it more readable
authorChristopher Faulet <cfaulet@haproxy.com>
Fri, 12 Feb 2021 18:59:21 +0000 (19:59 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 25 Feb 2021 09:02:39 +0000 (10:02 +0100)
commit131b07be3c7792d241603889c138d9d7bfa4fffa
tree5b02a745925c3d3959248243427179dc00f8562c
parent2a031ecd96159c964182375fb0e868571beb2ebf
MEDIUM: server: Refactor apply_server_state() to make it more readable

The apply_server_state() function is really hard to read. Thus it was
refactored to be more maintainable. First, an helper function is used to get
the server-state file path. Some useless variables were removed and most of
other variables were renamed to be more readable. The error messages are now
prefixed to know the context (global vs per-proxy). Finally, the loop on the
proxies list was simplified.

This patch may seem a bit huge, but the changes are not so important.
src/server.c