diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-10-19 16:21:30 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-10-19 16:21:30 +0100 |
commit | 5ff74f74982d8e7101a73b081bf9b9f901e92952 (patch) | |
tree | 7e348cca7bff1d142f5edaf4042b1c440d15776f | |
parent | b01538f33873cbe99151b29557c227a5f6a4f151 (diff) | |
download | rspamd-5ff74f74982d8e7101a73b081bf9b9f901e92952.tar.gz rspamd-5ff74f74982d8e7101a73b081bf9b9f901e92952.zip |
Check unique redirector calls per SURBL suffix
-rw-r--r-- | src/plugins/surbl.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/plugins/surbl.c b/src/plugins/surbl.c index fb189e389..20c79f081 100644 --- a/src/plugins/surbl.c +++ b/src/plugins/surbl.c @@ -989,6 +989,9 @@ surbl_redirector_finish (struct rspamd_http_connection *conn, gchar *urlstr; task = param->task; + + g_hash_table_remove (param->tree, struri (param->url)); + if (msg->code == 200) { hdr = rspamd_http_message_find_header (msg, "Uri"); @@ -1149,11 +1152,17 @@ surbl_tree_url_callback (gpointer key, gpointer value, void *data) g_list_prepend (NULL, rspamd_mempool_strdup (task->task_pool, pat->ptr))); } - register_redirector_call (url, - param->task, - param->suffix, - pat->ptr, - param->tree); + + if (g_hash_table_lookup (param->tree, struri (url)) == NULL) { + g_hash_table_insert (param->tree, struri (url), url); + + register_redirector_call (url, + param->task, + param->suffix, + pat->ptr, + param->tree); + } + return; } } |