]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: lua: Create the global 'act' object to register all action return codes
authorChristopher Faulet <cfaulet@haproxy.com>
Fri, 31 Jan 2020 17:57:12 +0000 (18:57 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 6 Feb 2020 14:13:03 +0000 (15:13 +0100)
commit0f3c8907c320d9c2c44c7fbecc843996756081ec
tree35f3d71ebe92a87a93a8b592ab9be255c788da94
parent7716cdf450b8a18780f359cb3fd2127609ffb2df
MINOR: lua: Create the global 'act' object to register all action return codes

ACT_RET_* code are now available from lua scripts. The gloabl object "act" is
used to register these codes as constant. Now, lua actions can return any of
following codes :

  * act.CONTINUE for ACT_RET_CONT
  * act.STOP for ACT_RET_STOP
  * act.YIELD for ACT_RET_YIELD
  * act.ERROR for ACT_RET_ERR
  * act.DONE for ACT_RET_DONE
  * act.DENY for ACT_RET_DENY
  * act.ABORT for ACT_RET_ABRT
  * act.INVALID for ACT_RET_INV

For instance, following script denied all requests :

  core.register_action("deny", { "http-req" }, function (txn)
      return act.DENY
  end)

Thus "http-request lua.deny" do exactly the same than "http-request deny".
doc/lua-api/index.rst
src/hlua.c