aboutsummaryrefslogtreecommitdiffstats
path: root/lualib/lua_scanners/razor.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/razor.lua
parent84e869eb4b74363b86c1da364e7063a82bc9375b (diff)
downloadrspamd-b6f01cfb0c5fda0b92fc7d8e2e0f7c63d2a7b07f.tar.gz
rspamd-b6f01cfb0c5fda0b92fc7d8e2e0f7c63d2a7b07f.zip
[Rework] Pass upstream when sending TCP requests
Diffstat (limited to 'lualib/lua_scanners/razor.lua')
-rw-r--r--lualib/lua_scanners/razor.lua8
1 files changed, 2 insertions, 6 deletions
diff --git a/lualib/lua_scanners/razor.lua b/lualib/lua_scanners/razor.lua
index 62b1e06a1..7de4c84eb 100644
--- a/lualib/lua_scanners/razor.lua
+++ b/lualib/lua_scanners/razor.lua
@@ -90,9 +90,6 @@ local function razor_check(task, content, digest, rule)
local function razor_callback(err, data, conn)
local function razor_requery()
- -- set current upstream to fail because an error occurred
- upstream:fail()
-
-- retry with another upstream until retransmits exceeds
if retransmits > 0 then
@@ -112,6 +109,7 @@ local function razor_check(task, content, digest, rule)
task = task,
host = addr:to_string(),
port = addr:get_port(),
+ upstream = upstream,
timeout = rule.timeout or 2.0,
shutdown = true,
data = content,
@@ -129,9 +127,6 @@ local function razor_check(task, content, digest, rule)
razor_requery()
else
- -- Parse the response
- if upstream then upstream:ok() end
-
--[[
@todo: Razorsocket currently only returns ham or spam. When the wrapper is fixed we should add dynamic scores here.
Maybe check spamassassin implementation.
@@ -163,6 +158,7 @@ local function razor_check(task, content, digest, rule)
task = task,
host = addr:to_string(),
port = addr:get_port(),
+ upstream = upstream,
timeout = rule.timeout or 2.0,
shutdown = true,
data = content,