MEDIUM: vars: make var_clear() only reset VF_PERMANENT variables
authorWilly Tarreau <w@1wt.eu>
Wed, 8 Sep 2021 13:03:58 +0000 (15:03 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 8 Sep 2021 13:06:11 +0000 (15:06 +0200)
commitc1c88f4809092bbf9ba1d6f56cbc46f0e3fee146
tree2317880cf39deddab4795ba1167fb23c39b6664b
parent3dc6dc3178a7ea61eacf11a31541cfdb22321174
MEDIUM: vars: make var_clear() only reset VF_PERMANENT variables

We certainly do not want that a permanent variable (one that is listed
in the configuration) be erased by accident by an "unset-var" action.
Let's make sure these ones are only reset to an empty sample, like at
the moment of their initial registration. One trick is that the same
function is used to purge the memory at the end and to delete, so we
need to add an extra "force" argument to make the choice.
include/haproxy/vars.h
src/vars.c