diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-08-19 21:12:56 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-08-19 21:12:56 +0100 |
commit | cd838060205ced7068d59d569ea959e28452ed0c (patch) | |
tree | 40f502518084ac62bbe253c56203212bfdb0539d /src/plugins | |
parent | 0626200288019b3da207101dc31a3c83dfed8d76 (diff) | |
download | rspamd-cd838060205ced7068d59d569ea959e28452ed0c.tar.gz rspamd-cd838060205ced7068d59d569ea959e28452ed0c.zip |
[Minor] Use lua string split instead of switching to C
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/lua/ip_score.lua | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/plugins/lua/ip_score.lua b/src/plugins/lua/ip_score.lua index 879aff74c..b1cf5c1bd 100644 --- a/src/plugins/lua/ip_score.lua +++ b/src/plugins/lua/ip_score.lua @@ -57,8 +57,6 @@ local options = { score_divisor = 1, } -local asn_re = rspamd_regexp.create_cached("[\\|\\s]") - local function ip_score_hash_key(asn, country, ipnet, ip) -- We use the most common attribute as hashing key if country then @@ -231,7 +229,7 @@ local ip_score_check = function(task) -- XXX: upstreams end local function calculate_score(score) - local parts = asn_re:split(score) + local parts = rspamd_lua_utils.rspamd_str_split(score, '|') local rep = tonumber(parts[1]) local total = tonumber(parts[2]) @@ -372,7 +370,7 @@ if redis_params then -- Register ip_score module rspamd_config:register_symbol({ name = 'IPSCORE_SAVE', - type = 'postfilter', + type = 'postfilter,nostat', priority = 5, callback = ip_score_set, }) |