aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-04-13 15:38:57 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-04-13 15:38:57 +0100
commit3e6a84d54bb0df15ac2ebf3e9d366b62bbf10a60 (patch)
tree3f13b171580f2b94f95e87fd6a0a529c8796a43f
parent18e6b7c84617bea86adf2653a21ab690cca76f65 (diff)
downloadrspamd-3e6a84d54bb0df15ac2ebf3e9d366b62bbf10a60.tar.gz
rspamd-3e6a84d54bb0df15ac2ebf3e9d366b62bbf10a60.zip
Save OSB window index inside token.
-rw-r--r--src/libstat/stat_internal.h3
-rw-r--r--src/libstat/tokenizers/osb.c2
2 files changed, 4 insertions, 1 deletions
diff --git a/src/libstat/stat_internal.h b/src/libstat/stat_internal.h
index 051404814..cb2a365c4 100644
--- a/src/libstat/stat_internal.h
+++ b/src/libstat/stat_internal.h
@@ -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;
diff --git a/src/libstat/tokenizers/osb.c b/src/libstat/tokenizers/osb.c
index 517b465fd..dd413a9b4 100644
--- a/src/libstat/tokenizers/osb.c
+++ b/src/libstat/tokenizers/osb.c
@@ -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);
}