mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-02-25 07:00:42 +00:00
While we do support process-wide variables ("proc.<name>"), there was no way to preset them from the configuration. This was particularly limiting their usefulness since configs involving them always had to first check if the variable was set prior to performing an operation. This patch adds a new "set-var" directive in the global section that supports setting the proc.<name> variables from an expression, like other set-var actions do. The syntax however follows what is already being done for setenv, which consists in having one argument for the variable name and another one for the expression. Only "constant" expressions are allowed here, such as "int", "str" etc, combined with arithmetic or string converters, and variable lookups. A few extra sample fetch keywords like "date", "rand" and "uuid" are also part of the constant expressions and may make sense to allow to create a random key or differentiate processes. The way it was done consists in parsing a dummy rule an executing the expression in the CFG_PARSE context, then releasing the expression. This is safe because the sample that variables store does not hold a back pointer to expression that created them. |
||
---|---|---|
.. | ||
design-thoughts | ||
internals | ||
lua-api | ||
51Degrees-device-detection.txt | ||
acl.fig | ||
architecture.txt | ||
close-options.txt | ||
coding-style.txt | ||
configuration.txt | ||
cookie-options.txt | ||
DeviceAtlas-device-detection.txt | ||
gpl.txt | ||
haproxy.1 | ||
intro.txt | ||
lgpl.txt | ||
linux-syn-cookies.txt | ||
lua.txt | ||
management.txt | ||
netscaler-client-ip-insertion-protocol.txt | ||
network-namespaces.txt | ||
peers-v2.0.txt | ||
peers.txt | ||
proxy-protocol.txt | ||
queuing.fig | ||
regression-testing.txt | ||
seamless_reload.txt | ||
SOCKS4.protocol.txt | ||
SPOE.txt | ||
WURFL-device-detection.txt |