aboutsummaryrefslogtreecommitdiffstats
path: root/lualib/lua_scanners/pyzor.lua
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rspamd.com>2022-07-02 14:53:24 +0100
committerVsevolod Stakhov <vsevolod@rspamd.com>2022-07-02 14:53:24 +0100
commitb6f01cfb0c5fda0b92fc7d8e2e0f7c63d2a7b07f (patch)
tree4d07a9618f1867ed6835797ccec2a1b00013b3e2 /lualib/lua_scanners/pyzor.lua
parent84e869eb4b74363b86c1da364e7063a82bc9375b (diff)
downloadrspamd-b6f01cfb0c5fda0b92fc7d8e2e0f7c63d2a7b07f.tar.gz
rspamd-b6f01cfb0c5fda0b92fc7d8e2e0f7c63d2a7b07f.zip
[Rework] Pass upstream when sending TCP requests
Diffstat (limited to 'lualib/lua_scanners/pyzor.lua')
-rw-r--r--lualib/lua_scanners/pyzor.lua7
1 files changed, 2 insertions, 5 deletions
diff --git a/lualib/lua_scanners/pyzor.lua b/lualib/lua_scanners/pyzor.lua
index ed0e3d16b..78250a3ad 100644
--- a/lualib/lua_scanners/pyzor.lua
+++ b/lualib/lua_scanners/pyzor.lua
@@ -85,9 +85,6 @@ local function pyzor_check(task, content, digest, rule)
if err then
- -- set current upstream to fail because an error occurred
- upstream:fail()
-
-- retry with another upstream until retransmits exceeds
if retransmits > 0 then
@@ -104,6 +101,7 @@ local function pyzor_check(task, content, digest, rule)
task = task,
host = addr:to_string(),
port = addr:get_port(),
+ upstream = upstream,
timeout = rule['timeout'],
shutdown = true,
data = content,
@@ -116,8 +114,6 @@ local function pyzor_check(task, content, digest, rule)
'failed to scan and retransmits exceed')
end
else
- -- Parse the response
- if upstream then upstream:ok() end
-- pyzor output is unicode (\x09 -> tab, \0a -> newline)
-- public.pyzor.org:24441 (200, 'OK') 21285091 206759
-- server:port Code Diag Count WL-Count
@@ -187,6 +183,7 @@ local function pyzor_check(task, content, digest, rule)
task = task,
host = addr:to_string(),
port = addr:get_port(),
+ upstream = upstream,
timeout = rule.timeout,
shutdown = true,
data = content,