aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2017-02-14 14:35:52 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2017-02-14 14:35:52 +0000
commit0064208668433a36973f828adf1db81b6e418f78 (patch)
treea0f7d6a09ccd04daa793ae864a75d0733ae6b41e
parenta3255c5529cf57fb07ffb9d1b35bfc85168497d0 (diff)
downloadrspamd-0064208668433a36973f828adf1db81b6e418f78.tar.gz
rspamd-0064208668433a36973f828adf1db81b6e418f78.zip
[Fix] Fix tokens usage
-rw-r--r--src/libutil/shingles.c7
-rw-r--r--src/plugins/chartable.c6
2 files changed, 8 insertions, 5 deletions
diff --git a/src/libutil/shingles.c b/src/libutil/shingles.c
index b2990de63..236e8113a 100644
--- a/src/libutil/shingles.c
+++ b/src/libutil/shingles.c
@@ -17,6 +17,7 @@
#include "fstring.h"
#include "cryptobox.h"
#include "images.h"
+#include "libstat/stat_api.h"
#define SHINGLES_WINDOW 3
@@ -34,7 +35,7 @@ rspamd_shingles_from_text (GArray *input,
guchar shabuf[rspamd_cryptobox_HASHBYTES], *out_key;
const guchar *cur_key;
rspamd_fstring_t *row;
- rspamd_ftok_t *word;
+ rspamd_stat_token_t *word;
rspamd_cryptobox_hash_state_t bs;
guint64 val;
gint i, j, k;
@@ -81,7 +82,7 @@ rspamd_shingles_from_text (GArray *input,
for (i = 0; i <= (gint)input->len; i ++) {
if (i - beg >= SHINGLES_WINDOW || i == (gint)input->len) {
for (j = beg; j < i; j ++) {
- word = &g_array_index (input, rspamd_ftok_t, j);
+ word = &g_array_index (input, rspamd_stat_token_t, j);
row = rspamd_fstring_append (row, word->begin, word->len);
}
@@ -125,7 +126,7 @@ rspamd_shingles_from_text (GArray *input,
res[j * SHINGLES_WINDOW + k + 1];
}
- word = &g_array_index (input, rspamd_ftok_t, beg);
+ word = &g_array_index (input, rspamd_stat_token_t, beg);
/* Insert the last element to the pipe */
memcpy (&seed, keys[j], sizeof (seed));
res[j * SHINGLES_WINDOW + SHINGLES_WINDOW - 1] =
diff --git a/src/plugins/chartable.c b/src/plugins/chartable.c
index 172a69261..6e55ad358 100644
--- a/src/plugins/chartable.c
+++ b/src/plugins/chartable.c
@@ -254,7 +254,8 @@ rspamd_chartable_process_word_utf (struct rspamd_task *task,
}
}
- msg_debug_chartable ("word %T, badness: %.2f", w, badness);
+ msg_debug_chartable ("word %*s, badness: %.2f", (gint)w->len, w->begin,
+ badness);
return badness;
}
@@ -337,7 +338,8 @@ rspamd_chartable_process_word_ascii (struct rspamd_task *task,
badness = 4.0;
}
- msg_debug_chartable ("word %T, badness: %.2f", w, badness);
+ msg_debug_chartable ("word %*s, badness: %.2f", (gint)w->len, w->begin,
+ badness);
return badness;
}