]> git.kaiwu.me - haproxy.git/commit
CLEANUP: mworker: make mworker_create_master_cli more readable
authorValentine Krasnobaeva <vkrasnobaeva@haproxy.com>
Sat, 26 Oct 2024 13:03:19 +0000 (15:03 +0200)
committerValentine Krasnobaeva <vkrasnobaeva@haproxy.com>
Sat, 26 Oct 2024 20:26:49 +0000 (22:26 +0200)
commit745a4c5e934929e623e7d76d2b4d0d895f043b25
tree61b65ba1ecb5b80bc109c661e1cbe598c5a1c6c5
parent2f04ebe14aca91f4a0fafcd03a0f310d98d97aaf
CLEANUP: mworker: make mworker_create_master_cli more readable

Using nested 'if' operator, while checking if we will need to allocate again the
"reload" sockpair, does not degrade performance, as mworker_create_master_cli is
a startup routine.

This nested 'if' (we check one condition in each operator) makes more visible the
fact, that the "reload" sockpair is allocated only once, when the master process
starts and it does not re-allocated again (hence, its FDs are not closed) during
reloads. This way of checking multiple conditions here makes more easy to spot
this fact, while analysing the code in order to investigate FD leaks between
master and worker.
src/mworker.c