]> source.dussan.org Git - rspamd.git/commitdiff
Save OSB window index inside token.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 13 Apr 2015 14:38:57 +0000 (15:38 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 13 Apr 2015 14:38:57 +0000 (15:38 +0100)
src/libstat/stat_internal.h
src/libstat/tokenizers/osb.c

index 0514048148998d0dea6cdda562fa99d988f3f1d6..cb2a365c486879299b15a0fc9454ce9b8ceaa8cb 100644 (file)
@@ -72,9 +72,10 @@ struct rspamd_token_result {
        struct rspamd_classifier_runtime *cl_runtime;
 };
 
-#define RSPAMD_MAX_TOKEN_LEN 64
+#define RSPAMD_MAX_TOKEN_LEN 16
 typedef struct token_node_s {
        guchar data[RSPAMD_MAX_TOKEN_LEN];
+       guint window_idx;
        guint datalen;
        GArray *results;
 } rspamd_token_t;
index 517b465fd6ab37876c55eaeb316e12250b96a8e0..dd413a9b4736e6d81f4528174b3e7dd3d1654864 100644 (file)
@@ -286,6 +286,8 @@ rspamd_tokenizer_osb (struct rspamd_tokenizer_config *cf,
                                        memcpy (new->data, &cur, sizeof (cur));
                                }
 
+                               new->window_idx = i;
+
                                if (g_tree_lookup (tree, new) == NULL) {
                                        g_tree_insert (tree, new, new);
                                }