aboutsummaryrefslogtreecommitdiffstats
path: root/src/libmime
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2020-03-07 12:15:51 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2020-03-09 10:46:11 +0000
commit50a043a7cbce8142d81b7887d263a9573ff568eb (patch)
tree403d02dc57b10b9016696fed678332bc01756e44 /src/libmime
parentc399a6013b8522fc28ed11839fae6cbe7062278a (diff)
downloadrspamd-50a043a7cbce8142d81b7887d263a9573ff568eb.tar.gz
rspamd-50a043a7cbce8142d81b7887d263a9573ff568eb.zip
[Rework] Urls: more rework of the urls sets
Diffstat (limited to 'src/libmime')
-rw-r--r--src/libmime/message.c8
-rw-r--r--src/libmime/message.h4
2 files changed, 4 insertions, 8 deletions
diff --git a/src/libmime/message.c b/src/libmime/message.c
index a43e109b5..40b7fe8bc 100644
--- a/src/libmime/message.c
+++ b/src/libmime/message.c
@@ -1048,8 +1048,7 @@ rspamd_message_dtor (struct rspamd_message *msg)
g_ptr_array_unref (msg->text_parts);
g_ptr_array_unref (msg->parts);
- g_hash_table_unref (msg->urls);
- g_hash_table_unref (msg->emails);
+ kh_destroy (rspamd_url_hash, msg->urls);
}
struct rspamd_message*
@@ -1060,10 +1059,7 @@ rspamd_message_new (struct rspamd_task *task)
msg = rspamd_mempool_alloc0 (task->task_pool, sizeof (*msg));
msg->raw_headers = rspamd_message_headers_new ();
-
- msg->emails = g_hash_table_new (rspamd_email_hash, rspamd_emails_cmp);
- msg->urls = g_hash_table_new (rspamd_url_hash, rspamd_urls_cmp);
-
+ msg->urls = kh_init (rspamd_url_hash);
msg->parts = g_ptr_array_sized_new (4);
msg->text_parts = g_ptr_array_sized_new (2);
msg->task = task;
diff --git a/src/libmime/message.h b/src/libmime/message.h
index 91d6e13d4..96ed9d5d4 100644
--- a/src/libmime/message.h
+++ b/src/libmime/message.h
@@ -13,6 +13,7 @@
#include "libcryptobox/cryptobox.h"
#include "libmime/mime_headers.h"
#include "libmime/content_type.h"
+#include "libserver/url.h"
#include "libutil/ref.h"
#include "libutil/str_util.h"
@@ -175,8 +176,7 @@ struct rspamd_message {
GPtrArray *text_parts; /**< list of text parts */
struct rspamd_message_raw_headers_content raw_headers_content;
struct rspamd_received_header *received; /**< list of received headers */
- GHashTable *urls; /**< list of parsed urls */
- GHashTable *emails; /**< list of parsed emails */
+ khash_t (rspamd_url_hash) *urls;
struct rspamd_mime_headers_table *raw_headers; /**< list of raw headers */
struct rspamd_mime_header *headers_order; /**< order of raw headers */
struct rspamd_task *task;