url_scanner->tld_trie = rspamd_trie_create (TRUE);
rspamd_url_add_static_matchers (url_scanner->matchers);
- if (cfg->tld_file) {
+ if (cfg != NULL && cfg->tld_file) {
rspamd_url_parse_tld_file (cfg->tld_file, url_scanner);
}
else {
int form; /* URI originated from form */
int is_phished; /* URI maybe phishing */
};
+ struct rspamd_config;
struct rspamd_url* rspamd_url_get_next (void *pool,
const char *start, char const **pos);
void * rspamd_mempool_new (unsigned long size);
+ void rspamd_url_init (struct rspamd_config *cfg);
]]
test("Extract urls from text", function()
{"http://user:password@тест2.РФ:18 text", {"тест2.рф", "user"}},
}
+ ffi.C.rspamd_url_init(nil)
+
for _,c in ipairs(cases) do
local res = ffi.C.rspamd_url_get_next(pool, c[1], nil)