Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

rspamd_test_helper.lua 392B

123456789101112131415161718
  1. local ffi = require "ffi"
  2. local cfg = rspamd_config
  3. ffi.cdef[[
  4. void rspamd_url_init (const char *tld_file);
  5. ]]
  6. local exports = {}
  7. function exports.init_url_parser(file)
  8. if not file then
  9. local test_dir = string.gsub(debug.getinfo(1).source, "^@(.+/)[^/]+$", "%1")
  10. file = string.format('%s/unit/%s', test_dir, "test_tld.dat")
  11. end
  12. ffi.C.rspamd_url_init(file)
  13. end
  14. return exports