aboutsummaryrefslogtreecommitdiffstats
path: root/src/url.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2011-02-24 18:51:13 +0300
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2011-02-24 18:51:13 +0300
commit121efbcddf8ec41eea91aa80574dab3730bf8976 (patch)
tree2d39b5895526d63c7994aa81575c2db15a46cee1 /src/url.c
parent7eb9b642db888b26a97b06394695e55173c45895 (diff)
downloadrspamd-121efbcddf8ec41eea91aa80574dab3730bf8976.tar.gz
rspamd-121efbcddf8ec41eea91aa80574dab3730bf8976.zip
* Rewrite URL storage system
Diffstat (limited to 'src/url.c')
-rw-r--r--src/url.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/url.c b/src/url.c
index b24392056..083ceecba 100644
--- a/src/url.c
+++ b/src/url.c
@@ -1185,13 +1185,18 @@ url_parse_text (memory_pool_t * pool, struct worker_task *task, struct mime_text
if (new != NULL) {
g_strstrip (url_str);
rc = parse_uri (new, url_str, pool);
- if (rc == URI_ERRNO_OK || rc == URI_ERRNO_NO_SLASHES || rc == URI_ERRNO_NO_HOST_SLASH) {
+ if ((rc == URI_ERRNO_OK || rc == URI_ERRNO_NO_SLASHES || rc == URI_ERRNO_NO_HOST_SLASH) &&
+ new->hostlen > 0) {
if (new->protocol == PROTOCOL_MAILTO) {
- task->emails = g_list_prepend (task->emails, new);
+ if (!g_tree_lookup (task->emails, new)) {
+ g_tree_insert (task->emails, new, new);
+ }
}
else {
g_tree_insert (is_html ? part->html_urls : part->urls, url_str, new);
- task->urls = g_list_prepend (task->urls, new);
+ if (!g_tree_lookup (task->urls, new)) {
+ g_tree_insert (task->urls, new, new);
+ }
}
}
else {