]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Finally kill cymru
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 3 Oct 2016 15:25:17 +0000 (16:25 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 3 Oct 2016 15:25:33 +0000 (16:25 +0100)
src/plugins/lua/asn.lua

index f61c82096429ee1abb32938e39051494818fa2d8..2bb380edc2accf3ed308c6e46bf903d53f82807b 100644 (file)
@@ -31,7 +31,7 @@ local options = {
 }
 local redis_params
 
-local cymru_re = rspamd_regexp.create_cached("[\\|\\s]")
+local rspamd_re = rspamd_regexp.create_cached("[\\|\\s]")
 
 local function asn_check(task)
 
@@ -55,10 +55,10 @@ local function asn_check(task)
   end
 
   local asn_check_func = {}
-  function asn_check_func.cymru(ip)
-    local function cymru_dns_cb(resolver, to_resolve, results, err, key)
+  function asn_check_func.rspamd(ip)
+    local function rspamd_dns_cb(resolver, to_resolve, results, err, key)
       if not (results and results[1]) then return end
-      local parts = cymru_re:split(results[1])
+      local parts = rspamd_re:split(results[1])
       -- "15169 | 8.8.8.0/24 | US | arin |" for 8.8.8.8
       asn_set(parts[1], parts[2], parts[3])
 
@@ -95,7 +95,7 @@ local function asn_check(task)
     local req_name = rspamd_logger.slog("%1.%2",
         table.concat(ip:inversed_str_octets(), '.'), dnsbl)
     task:get_resolver():resolve_txt(task:get_session(), task:get_mempool(),
-        req_name, cymru_dns_cb)
+        req_name, rspamd_dns_cb)
   end
 
   local function asn_check_cache(ip, continuation_func)
@@ -153,10 +153,10 @@ local configure_asn_module = function()
       options[k] = v
     end
   end
-  if options['provider_type'] == 'cymru' then
+  if options['provider_type'] == 'rspamd' then
     if not options['provider_info'] and options['provider_info']['ip4'] and
         options['provider_info']['ip6'] then
-      rspamd_logger.errx("Missing required provider_info for cymru")
+      rspamd_logger.errx("Missing required provider_info for rspamd")
       return false
     end
   else