aboutsummaryrefslogtreecommitdiffstats
path: root/src/libstat/stat_process.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-09-15 11:57:34 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-09-15 11:57:34 +0100
commitcb22681cd8f5ef4d4be31eb38d26f699a3e54409 (patch)
treec3fbe1bd6ed3c23daad66c32d7386527bac856cb /src/libstat/stat_process.c
parent2c70f249488615dee2e25a4c0062c981128b6f0b (diff)
downloadrspamd-cb22681cd8f5ef4d4be31eb38d26f699a3e54409.tar.gz
rspamd-cb22681cd8f5ef4d4be31eb38d26f699a3e54409.zip
[Minor] Use attachments filenames as bayes tokens
Diffstat (limited to 'src/libstat/stat_process.c')
-rw-r--r--src/libstat/stat_process.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/libstat/stat_process.c b/src/libstat/stat_process.c
index 388d6b4e3..1bc927270 100644
--- a/src/libstat/stat_process.c
+++ b/src/libstat/stat_process.c
@@ -77,7 +77,7 @@ rspamd_stat_tokenize_parts_metadata (struct rspamd_stat_ctx *st_ctx,
guint i;
gchar tmpbuf[128];
- ar = g_array_sized_new (FALSE, FALSE, sizeof (elt), 4);
+ ar = g_array_sized_new (FALSE, FALSE, sizeof (elt), 16);
/* Insert images */
for (i = 0; i < task->parts->len; i ++) {
@@ -110,6 +110,11 @@ rspamd_stat_tokenize_parts_metadata (struct rspamd_stat_ctx *st_ctx,
msg_debug_task ("added stat tokens for image '%s'", img->html_image->src);
}
}
+ else if (part->filename) {
+ elt.begin = (gchar *)part->filename;
+ elt.len = strlen (elt->begin);
+ g_array_append_val (ar, elt);
+ }
}
/* Process mime parts */