summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rspamd.com>2022-09-09 21:06:00 +0100
committerVsevolod Stakhov <vsevolod@rspamd.com>2022-09-09 21:06:00 +0100
commit08fb5403de2ac18b99924f522859de875c9cb87f (patch)
tree3163d2e64c14e0bcafcf1775586b73a506840798 /src/plugins
parente70bc00333e7639ac5f05bce2893221a589e451a (diff)
downloadrspamd-08fb5403de2ac18b99924f522859de875c9cb87f.tar.gz
rspamd-08fb5403de2ac18b99924f522859de875c9cb87f.zip
[Minor] Add timeout augmentation for external services/av plugins
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/lua/antivirus.lua8
-rw-r--r--src/plugins/lua/external_services.lua8
2 files changed, 16 insertions, 0 deletions
diff --git a/src/plugins/lua/antivirus.lua b/src/plugins/lua/antivirus.lua
index c73e4fa2f..dba472c50 100644
--- a/src/plugins/lua/antivirus.lua
+++ b/src/plugins/lua/antivirus.lua
@@ -197,6 +197,14 @@ if opts and type(opts) == 'table' then
t.type = 'normal'
end
+ t.augmentations = {}
+
+ if type(m.timeout) == 'number' then
+ -- Here, we ignore possible DNS timeout and timeout from multiple retries
+ -- as these situations are not usual nor likely for the antivirus module
+ table.insert(t.augmentations, string.format("timeout=%f", m.timeout))
+ end
+
local id = rspamd_config:register_symbol(t)
rspamd_config:register_symbol({
diff --git a/src/plugins/lua/external_services.lua b/src/plugins/lua/external_services.lua
index bafcc9eec..96e6b9e94 100644
--- a/src/plugins/lua/external_services.lua
+++ b/src/plugins/lua/external_services.lua
@@ -227,6 +227,14 @@ if opts and type(opts) == 'table' then
t.type = 'normal'
end
+ t.augmentations = {}
+
+ if type(m.timeout) == 'number' then
+ -- Here, we ignore possible DNS timeout and timeout from multiple retries
+ -- as these situations are not usual nor likely for the external_services module
+ table.insert(t.augmentations, string.format("timeout=%f", m.timeout))
+ end
+
local id = rspamd_config:register_symbol(t)
if m.symbol_fail then