]> source.dussan.org Git - rspamd.git/commit
Improve lua callbacks call.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Sun, 17 Aug 2014 17:44:56 +0000 (18:44 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Sun, 17 Aug 2014 17:44:56 +0000 (18:44 +0100)
commitc6a703e720a6a3d20a86db115272ca356d59fa11
tree240a66381cc02e6d54f2902db309ee3159dedec1
parentea2425753d00a15e0f56fde3ac675e262cb86638
Improve lua callbacks call.

Now it is possible to return a value from lua callback and rspamd can
automatically insert the symbol corresponding.

For example:

rspamd_config.TEST = function(task)
...
 return true -- inserts symbol TEST with the default value
...
 return true, 0.5 -- inserts symbol TEST with 0.5 multiplier
...
 return true, "opt1", "opt2" -- insert symbol with the options specified
...
 return true, 0.5, "opt1", "opt2"
...
end
src/lua/lua_config.c