aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-04-21 18:06:25 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-04-21 18:06:25 +0100
commitf74ba68df22a4bec9f8b23531aaa5f349c6bb234 (patch)
treeea425f448af64b17d972f78d3a55d910933baa1d /src
parentbaa0aa0242b34d036cadcbf9f65dee311898d054 (diff)
downloadrspamd-f74ba68df22a4bec9f8b23531aaa5f349c6bb234.tar.gz
rspamd-f74ba68df22a4bec9f8b23531aaa5f349c6bb234.zip
Fuzzy actual version is now 3 not 2.
Diffstat (limited to 'src')
-rw-r--r--src/fuzzy_storage.c14
-rw-r--r--src/fuzzy_storage.h2
2 files changed, 15 insertions, 1 deletions
diff --git a/src/fuzzy_storage.c b/src/fuzzy_storage.c
index 77a5b9a55..22b61256a 100644
--- a/src/fuzzy_storage.c
+++ b/src/fuzzy_storage.c
@@ -214,6 +214,20 @@ rspamd_fuzzy_command_valid (struct rspamd_fuzzy_cmd *cmd, gint r)
return (r == sizeof (*cmd));
}
}
+ else if (cmd->version == 2) {
+ /*
+ * rspamd 0.8 has slightly different tokenizer then it might be not
+ * 100% compatible
+ */
+ if (cmd->shingles_count > 0) {
+ if (r == sizeof (struct rspamd_fuzzy_shingle_cmd)) {
+ return TRUE;
+ }
+ }
+ else {
+ return (r == sizeof (*cmd));
+ }
+ }
return FALSE;
}
diff --git a/src/fuzzy_storage.h b/src/fuzzy_storage.h
index b3c65e4cd..e2803c52e 100644
--- a/src/fuzzy_storage.h
+++ b/src/fuzzy_storage.h
@@ -6,7 +6,7 @@
#include "fuzzy.h"
#include "shingles.h"
-#define RSPAMD_FUZZY_VERSION 2
+#define RSPAMD_FUZZY_VERSION 3
/* Commands for fuzzy storage */
#define FUZZY_CHECK 0