]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Fix tokens usage
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 14 Feb 2017 14:35:52 +0000 (14:35 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 14 Feb 2017 14:35:52 +0000 (14:35 +0000)
src/libutil/shingles.c
src/plugins/chartable.c

index b2990de63ca0e872d316d8e422a213f5438f4bd2..236e8113aeb191a4c285248334abd89246f9658d 100644 (file)
@@ -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] =
index 172a69261e2900c5700e370808e97e883f31ba90..6e55ad358bcfff22f101bd11d6a9d84244b217e9 100644 (file)
@@ -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;
 }