diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-01-04 12:58:37 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-01-04 12:58:37 +0000 |
commit | feb549d7fd4d87f5f62b59056da0de8a81c35041 (patch) | |
tree | 289593f650849c19a29bbe46c2cdd2a4708be1bd /src/plugins/lua | |
parent | c866ad0722f4af778fa686547be96bbd384e363f (diff) | |
download | rspamd-feb549d7fd4d87f5f62b59056da0de8a81c35041.tar.gz rspamd-feb549d7fd4d87f5f62b59056da0de8a81c35041.zip |
Avoid cached regexps
Diffstat (limited to 'src/plugins/lua')
-rw-r--r-- | src/plugins/lua/spamassassin.lua | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/plugins/lua/spamassassin.lua b/src/plugins/lua/spamassassin.lua index 7842e4e96..45be259df 100644 --- a/src/plugins/lua/spamassassin.lua +++ b/src/plugins/lua/spamassassin.lua @@ -672,7 +672,7 @@ local function process_sa_conf(f) or string.sub(words[3], 1, 1) == 'm') then cur_rule['type'] = 'part' cur_rule['re_expr'] = words_to_re(words, 2) - cur_rule['re'] = rspamd_regexp.create_cached(cur_rule['re_expr']) + cur_rule['re'] = rspamd_regexp.create(cur_rule['re_expr']) cur_rule['raw'] = true if cur_rule['re'] then @@ -711,7 +711,7 @@ local function process_sa_conf(f) or string.sub(words[3], 1, 1) == 'm') then cur_rule['type'] = 'message' cur_rule['re_expr'] = words_to_re(words, 2) - cur_rule['re'] = rspamd_regexp.create_cached(cur_rule['re_expr']) + cur_rule['re'] = rspamd_regexp.create(cur_rule['re_expr']) cur_rule['raw'] = true if cur_rule['re'] then valid_rule = true @@ -745,7 +745,7 @@ local function process_sa_conf(f) cur_rule['type'] = 'uri' cur_rule['symbol'] = words[2] cur_rule['re_expr'] = words_to_re(words, 2) - cur_rule['re'] = rspamd_regexp.create_cached(cur_rule['re_expr']) + cur_rule['re'] = rspamd_regexp.create(cur_rule['re_expr']) if cur_rule['re'] and cur_rule['symbol'] then valid_rule = true rspamd_config:register_regexp({ @@ -965,7 +965,7 @@ local function post_process() local nre = rspamd_regexp.create(nexpr) if not nre then rspamd_logger.errx(rspamd_config, 'cannot apply replacement for rule %1', r) - rule['re'] = nil + --rule['re'] = nil else local old_max_hits = rule['re']:get_max_hits() rspamd_logger.debugx(rspamd_config, 'replace %1 -> %2', r, nexpr) |