]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
Fuzzy actual version is now 3 not 2.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 21 Apr 2015 17:06:25 +0000 (18:06 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 21 Apr 2015 17:06:25 +0000 (18:06 +0100)
src/fuzzy_storage.c
src/fuzzy_storage.h

index 77a5b9a55cc60cda67d974ad4ba56e6984c24bea..22b61256a334b5738fa646d381dbe1230afd3e97 100644 (file)
@@ -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;
 }
index b3c65e4cd78219b869cb25f840b0fb812b224bab..e2803c52ee25f9603fda02c9cc1d4dca61fe45ff 100644 (file)
@@ -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