diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-01-05 15:36:43 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-01-05 15:36:43 +0000 |
commit | d26c0a18a7c5670e97bc23c902b609e17979122f (patch) | |
tree | da5cf48e64bdd08363b3a7af0f04c70e3087a076 /src/libserver/url.c | |
parent | f56cb9d4eca864b9943d33c1f83fcff49ec58a67 (diff) | |
download | rspamd-d26c0a18a7c5670e97bc23c902b609e17979122f.tar.gz rspamd-d26c0a18a7c5670e97bc23c902b609e17979122f.zip |
[Feature] Implement url tags concept
Diffstat (limited to 'src/libserver/url.c')
-rw-r--r-- | src/libserver/url.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/libserver/url.c b/src/libserver/url.c index 507913413..6bd42daea 100644 --- a/src/libserver/url.c +++ b/src/libserver/url.c @@ -2537,3 +2537,18 @@ rspamd_url_task_callback (struct rspamd_url *url, gsize start_offset, } } } + +void +rspamd_url_add_tag (struct rspamd_url *url, const gchar *tag, + rspamd_mempool_t *pool) +{ + g_assert (url != NULL && tag != NULL); + + if (url->tags == NULL) { + url->tags = g_ptr_array_sized_new (2); + rspamd_mempool_add_destructor (pool, rspamd_ptr_array_free_hard, url->tags); + } + + g_ptr_array_add (url->tags, rspamd_mempool_strdup (pool, tag)); + +} |