}
void
-rspamd_url_init (struct rspamd_config *cfg)
+rspamd_url_init (const gchar *tld_file)
{
guint i;
gchar patbuf[128];
url_scanner->tld_trie = rspamd_trie_create (TRUE);
rspamd_url_add_static_matchers (url_scanner->matchers);
- if (cfg != NULL && cfg->tld_file) {
- rspamd_url_parse_tld_file (cfg->tld_file, url_scanner);
+ if (tld_file != NULL) {
+ rspamd_url_parse_tld_file (tld_file, url_scanner);
}
else {
msg_warn ("tld extension file is not specified, url matching is limited");
struct rspamd_task;
struct mime_text_part;
-struct rspamd_config;
struct rspamd_url {
gchar *string;
* Initialize url library
* @param cfg
*/
-void rspamd_url_init (struct rspamd_config *cfg);
+void rspamd_url_init (const gchar *tld_file);
/*
* Parse urls inside text
}
rspamd_stat_init (rspamd_main->cfg);
- rspamd_url_init (rspamd_main->cfg);
+ rspamd_url_init (rspamd_main->cfg->tld_file);
/* Insert classifiers symbols */
(void)rspamd_config_insert_classify_symbols (rspamd_main->cfg);
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);
+ void rspamd_url_init (const char *tld_file);
]]
test("Extract urls from text", function()