From 6b676918bbb037c111fa2616f1709ead9ac3c788 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Wed, 21 Aug 2019 15:52:43 +0100 Subject: [Rework] Drop url tags --- src/libserver/html.c | 3 --- src/libserver/url.c | 28 ---------------------------- src/libserver/url.h | 11 ----------- 3 files changed, 42 deletions(-) (limited to 'src/libserver') diff --git a/src/libserver/html.c b/src/libserver/html.c index 4ff310f1c..fa33ffdfb 100644 --- a/src/libserver/html.c +++ b/src/libserver/html.c @@ -721,9 +721,6 @@ rspamd_html_url_is_phished (rspamd_mempool_t *pool, href_url->phished_url = text_url; phished_tld.begin = href_tok.begin; phished_tld.len = href_tok.len; - rspamd_url_add_tag (text_url, "phishing", - rspamd_mempool_ftokdup (pool, &phished_tld), - pool); text_url->flags |= RSPAMD_URL_FLAG_HTML_DISPLAYED; } } diff --git a/src/libserver/url.c b/src/libserver/url.c index 9314ce2bb..d770b2191 100644 --- a/src/libserver/url.c +++ b/src/libserver/url.c @@ -3176,34 +3176,6 @@ rspamd_url_task_subject_callback (struct rspamd_url *url, gsize start_offset, } } -void -rspamd_url_add_tag (struct rspamd_url *url, const gchar *tag, - const gchar *value, - rspamd_mempool_t *pool) -{ - struct rspamd_url_tag *found, *ntag; - - g_assert (url != NULL && tag != NULL && value != NULL); - - if (url->tags == NULL) { - url->tags = g_hash_table_new (rspamd_strcase_hash, rspamd_strcase_equal); - rspamd_mempool_add_destructor (pool, - (rspamd_mempool_destruct_t)g_hash_table_unref, url->tags); - } - - found = g_hash_table_lookup (url->tags, tag); - - ntag = rspamd_mempool_alloc0 (pool, sizeof (*ntag)); - ntag->data = rspamd_mempool_strdup (pool, value); - - if (found == NULL) { - g_hash_table_insert (url->tags, rspamd_mempool_strdup (pool, tag), - ntag); - } - - DL_APPEND (found, ntag); -} - guint rspamd_url_hash (gconstpointer u) { diff --git a/src/libserver/url.h b/src/libserver/url.h index 6f1ccf59f..d9e15e212 100644 --- a/src/libserver/url.h +++ b/src/libserver/url.h @@ -70,7 +70,6 @@ struct rspamd_url { enum rspamd_url_flags flags; guint count; - GHashTable *tags; }; enum uri_errno { @@ -214,16 +213,6 @@ void rspamd_url_task_subject_callback (struct rspamd_url *url, gsize start_offset, gsize end_offset, gpointer ud); -/** - * Adds a tag for url - * @param url - * @param tag - * @param pool - */ -void rspamd_url_add_tag (struct rspamd_url *url, const gchar *tag, - const gchar *value, - rspamd_mempool_t *pool); - guint rspamd_url_hash (gconstpointer u); guint rspamd_email_hash (gconstpointer u); -- cgit v1.2.3