aboutsummaryrefslogtreecommitdiffstats
path: root/lualib/lua_scanners/razor.lua
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rspamd.com>2023-08-07 11:41:28 +0100
committerVsevolod Stakhov <vsevolod@rspamd.com>2023-08-07 11:41:28 +0100
commit662145d0554de5e769b92dab2d41173a98adcee5 (patch)
treeec28311a0bce6181f248ba7b50304293ad764e44 /lualib/lua_scanners/razor.lua
parentbbd88232db43d18f5e0de5a6502848d4074621c5 (diff)
downloadrspamd-662145d0554de5e769b92dab2d41173a98adcee5.tar.gz
rspamd-662145d0554de5e769b92dab2d41173a98adcee5.zip
[Minor] Reformat all Lua code, no functional changes
Diffstat (limited to 'lualib/lua_scanners/razor.lua')
-rw-r--r--lualib/lua_scanners/razor.lua13
1 files changed, 6 insertions, 7 deletions
diff --git a/lualib/lua_scanners/razor.lua b/lualib/lua_scanners/razor.lua
index 7de4c84eb..fcc0a8e3a 100644
--- a/lualib/lua_scanners/razor.lua
+++ b/lualib/lua_scanners/razor.lua
@@ -80,7 +80,6 @@ local function razor_config(opts)
return nil
end
-
local function razor_check(task, content, digest, rule)
local function razor_check_uncached ()
local upstream = rule.upstreams:get_upstream_round_robin()
@@ -96,14 +95,14 @@ local function razor_check(task, content, digest, rule)
retransmits = retransmits - 1
lua_util.debugm(rule.name, task, '%s: Request Error: %s - retries left: %s',
- rule.log_prefix, err, retransmits)
+ rule.log_prefix, err, retransmits)
-- Select a different upstream!
upstream = rule.upstreams:get_upstream_round_robin()
addr = upstream:get_addr()
lua_util.debugm(rule.name, task, '%s: retry IP: %s:%s',
- rule.log_prefix, addr, addr:get_port())
+ rule.log_prefix, addr, addr:get_port())
tcp.request({
task = task,
@@ -116,8 +115,8 @@ local function razor_check(task, content, digest, rule)
callback = razor_callback,
})
else
- rspamd_logger.errx(task, '%s: failed to scan, maximum retransmits '..
- 'exceed', rule.log_prefix)
+ rspamd_logger.errx(task, '%s: failed to scan, maximum retransmits ' ..
+ 'exceed', rule.log_prefix)
common.yield_result(task, rule, 'failed to scan and retransmits exceed', 0.0, 'fail')
end
end
@@ -148,7 +147,7 @@ local function razor_check(task, content, digest, rule)
end
common.save_cache(task, digest, rule, 'OK', rule.default_score)
else
- rspamd_logger.errx(task,"%s - unknown response from razorfy: %s", addr:to_string(), threat_string)
+ rspamd_logger.errx(task, "%s - unknown response from razorfy: %s", addr:to_string(), threat_string)
end
end
@@ -174,7 +173,7 @@ local function razor_check(task, content, digest, rule)
end
return {
- type = {'razor','spam', 'hash', 'scanner'},
+ type = { 'razor', 'spam', 'hash', 'scanner' },
description = 'razor bulk scanner',
configure = razor_config,
check = razor_check,