diff options
author | Mikhail Galanin <mgalanin@mimecast.com> | 2018-08-17 16:39:02 +0100 |
---|---|---|
committer | Mikhail Galanin <mgalanin@mimecast.com> | 2018-08-17 16:39:02 +0100 |
commit | 46b69af3b0dde1b24b518d92668e1073f674efb2 (patch) | |
tree | db26f28a615733bee37c6f686c2630e29f3abf4c /src/plugins/lua/multimap.lua | |
parent | ac7cb176fd1eb72a891e4c245d1094c0175a1bad (diff) | |
download | rspamd-46b69af3b0dde1b24b518d92668e1073f674efb2.tar.gz rspamd-46b69af3b0dde1b24b518d92668e1073f674efb2.zip |
[Minor] Moved coroutine-related functionality of DNS resolver into a separated module
Diffstat (limited to 'src/plugins/lua/multimap.lua')
-rw-r--r-- | src/plugins/lua/multimap.lua | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/plugins/lua/multimap.lua b/src/plugins/lua/multimap.lua index 4fe69ef88..4514bc4f7 100644 --- a/src/plugins/lua/multimap.lua +++ b/src/plugins/lua/multimap.lua @@ -28,6 +28,7 @@ local regexp = require "rspamd_regexp" local rspamd_expression = require "rspamd_expression" local rspamd_ip = require "rspamd_ip" local lua_util = require "lua_util" +local rspamd_dns = require "rspamd_dns" local redis_params local fun = require "fun" local N = 'multimap' @@ -703,12 +704,13 @@ local function multimap_callback(task, rule) else local to_resolve = ip_to_rbl(ip, rule['map']) - local is_ok, results = task:get_resolver():resolve_a({ + local is_ok, results = rspamd_dns.request({ + type = "a", task = task, name = to_resolve, }) - lua_util.debugm(N, rspamd_config, 'resolve_a() finished: results=%1, is_ok=%2, to_resolve=%3', results, is_ok, to_resolve) + lua_util.debugm(N, rspamd_config, 'resolve() finished: results=%1, is_ok=%2, to_resolve=%3', results, is_ok, to_resolve) if not is_ok and (results ~= 'requested record is not found' and results ~= 'no records with this name') then rspamd_logger.errx(task, 'error looking up %s: %s', to_resolve, results) |