]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: lua: Add `ifexist` parameter to `set_var`
authorTim Duesterhus <tim@bastelstu.be>
Tue, 19 May 2020 11:49:42 +0000 (13:49 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Mon, 25 May 2020 06:12:35 +0000 (08:12 +0200)
commit4e172c93f9f28c2cc3d1af3a36dec5be62b077d3
treef6598fd6ca356fcfadaaa37617bbab27cfa9b50e
parent84ebc136a135c708744f98f742e866bd14e2e31e
MEDIUM: lua: Add `ifexist` parameter to `set_var`

As discussed in GitHub issue #624 Lua scripts should not use
variables that are never going to be read, because the memory
for variable names is never going to be freed.

Add an optional `ifexist` parameter to the `set_var` function
that allows a Lua developer to set variables that are going to
be ignored if the variable name was not used elsewhere before.

Usually this mean that there is no `var()` sample fetch for the
variable in question within the configuration.
doc/lua-api/index.rst
reg-tests/lua/set_var.lua
reg-tests/lua/set_var.vtc
src/hlua.c