diff options
author | Vsevolod Stakhov <vsevolod@rspamd.com> | 2022-07-02 14:53:24 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rspamd.com> | 2022-07-02 14:53:24 +0100 |
commit | b6f01cfb0c5fda0b92fc7d8e2e0f7c63d2a7b07f (patch) | |
tree | 4d07a9618f1867ed6835797ccec2a1b00013b3e2 /lualib/lua_scanners/sophos.lua | |
parent | 84e869eb4b74363b86c1da364e7063a82bc9375b (diff) | |
download | rspamd-b6f01cfb0c5fda0b92fc7d8e2e0f7c63d2a7b07f.tar.gz rspamd-b6f01cfb0c5fda0b92fc7d8e2e0f7c63d2a7b07f.zip |
[Rework] Pass upstream when sending TCP requests
Diffstat (limited to 'lualib/lua_scanners/sophos.lua')
-rw-r--r-- | lualib/lua_scanners/sophos.lua | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lualib/lua_scanners/sophos.lua b/lualib/lua_scanners/sophos.lua index b82a71025..d9b64f1a8 100644 --- a/lualib/lua_scanners/sophos.lua +++ b/lualib/lua_scanners/sophos.lua @@ -90,9 +90,6 @@ local function sophos_check(task, content, digest, rule, maybe_part) local function sophos_callback(err, data, conn) 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 @@ -109,6 +106,7 @@ local function sophos_check(task, content, digest, rule, maybe_part) task = task, host = addr:to_string(), port = addr:get_port(), + upstream = upstream, timeout = rule['timeout'], callback = sophos_callback, data = { protocol, streamsize, content, bye } @@ -119,7 +117,6 @@ local function sophos_check(task, content, digest, rule, maybe_part) 0.0, 'fail', maybe_part) end else - upstream:ok() data = tostring(data) lua_util.debugm(rule.name, task, '%s [%s]: got reply: %s', rule['symbol'], rule['type'], data) @@ -170,6 +167,7 @@ local function sophos_check(task, content, digest, rule, maybe_part) task = task, host = addr:to_string(), port = addr:get_port(), + upstream = upstream, timeout = rule['timeout'], callback = sophos_callback, data = { protocol, streamsize, content, bye } |