aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-11-12 13:27:25 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-11-12 13:27:25 +0000
commitc967577fbd835bc1db05907aa754acdd56a4f6aa (patch)
tree8c7eb6e620ed6860be7956b81c131243037c5281 /src
parent2c256794ff455b4e39868fc860afec24b4326f6a (diff)
downloadrspamd-c967577fbd835bc1db05907aa754acdd56a4f6aa.tar.gz
rspamd-c967577fbd835bc1db05907aa754acdd56a4f6aa.zip
[Feature] Support multiple hashes in delhash path
Diffstat (limited to 'src')
-rw-r--r--src/plugins/fuzzy_check.c33
1 files changed, 20 insertions, 13 deletions
diff --git a/src/plugins/fuzzy_check.c b/src/plugins/fuzzy_check.c
index f1e5b0602..803958b81 100644
--- a/src/plugins/fuzzy_check.c
+++ b/src/plugins/fuzzy_check.c
@@ -2429,26 +2429,33 @@ fuzzy_process_handler (struct rspamd_http_connection_entry *conn_ent,
res = 0;
if (is_hash) {
+ GPtrArray *args;
const rspamd_ftok_t *arg;
+ guint i;
- arg = rspamd_http_message_find_header (msg, "Hash");
+ args = rspamd_http_message_find_header_multiple (msg, "Hash");
- if (arg) {
+ if (args) {
struct fuzzy_cmd_io *io;
+ commands = g_ptr_array_sized_new (args->len);
- io = fuzzy_cmd_hash (rule, cmd, arg, flag, value,
- task->task_pool);
+ for (i = 0; i < args->len; i ++) {
+ arg = g_ptr_array_index (args, i);
+ io = fuzzy_cmd_hash (rule, cmd, arg, flag, value,
+ task->task_pool);
- if (io) {
- commands = g_ptr_array_sized_new (1);
- g_ptr_array_add (commands, io);
- res = register_fuzzy_controller_call (conn_ent,
- rule,
- task,
- commands,
- saved,
- err);
+ if (io) {
+ g_ptr_array_add (commands, io);
+ }
}
+
+ res = register_fuzzy_controller_call (conn_ent,
+ rule,
+ task,
+ commands,
+ saved,
+ err);
+ g_ptr_array_free (args, TRUE);
}
else {
rspamd_controller_send_error (conn_ent, 400,