diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2011-02-24 18:51:13 +0300 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2011-02-24 18:51:13 +0300 |
commit | 121efbcddf8ec41eea91aa80574dab3730bf8976 (patch) | |
tree | 2d39b5895526d63c7994aa81575c2db15a46cee1 /src/url.c | |
parent | 7eb9b642db888b26a97b06394695e55173c45895 (diff) | |
download | rspamd-121efbcddf8ec41eea91aa80574dab3730bf8976.tar.gz rspamd-121efbcddf8ec41eea91aa80574dab3730bf8976.zip |
* Rewrite URL storage system
Diffstat (limited to 'src/url.c')
-rw-r--r-- | src/url.c | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -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 { |