aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2014-08-25 13:56:05 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2014-08-25 13:56:05 +0100
commit7fd453d4b676a50d0749c62695c0142811c7dc91 (patch)
tree0f28c554294cb6ee49639d59fcf1bc8457b60c0d
parent2c36e76ffa0980e2e103a55488938c01be2ceb73 (diff)
downloadrspamd-7fd453d4b676a50d0749c62695c0142811c7dc91.tar.gz
rspamd-7fd453d4b676a50d0749c62695c0142811c7dc91.zip
Adopt trie plugin.
-rw-r--r--src/plugins/lua/trie.lua6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/plugins/lua/trie.lua b/src/plugins/lua/trie.lua
index bda978cb7..d0d77e796 100644
--- a/src/plugins/lua/trie.lua
+++ b/src/plugins/lua/trie.lua
@@ -1,6 +1,8 @@
-- Trie is rspamd module designed to define and operate with suffix trie
local tries = {}
+local rspamd_logger = require "rspamd_logger"
+local rspamd_trie = require "rspamd_trie"
local function split(str, delim, maxNb)
-- Eliminate bad cases...
@@ -33,7 +35,7 @@ local function add_trie(params)
file = io.open(params[2])
if file then
local trie = {}
- trie['trie'] = rspamd_trie:create(true)
+ trie['trie'] = rspamd_trie.create(true)
num = 0
for line in file:lines() do
trie['trie']:add_pattern(line, num)
@@ -49,7 +51,7 @@ local function add_trie(params)
else
local patterns = split(params[2], ',')
local trie = {}
- trie['trie'] = rspamd_trie:create(true)
+ trie['trie'] = rspamd_trie.create(true)
for num,pattern in ipairs(patterns) do
trie['trie']:add_pattern(pattern, num)
end