commit 6997861: [Minor] Store approximation
Vsevolod Stakhov
vsevolod at rspamd.com
Mon Jul 29 17:49:13 UTC 2024
Author: Vsevolod Stakhov
Date: 2023-11-21 16:26:36 +0000
URL: https://github.com/rspamd/rspamd/commit/69978615370266e53b86d73835fcf7f665b73d6d (refs/pull/4714/head)
[Minor] Store approximation
---
src/fuzzy_storage.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/fuzzy_storage.c b/src/fuzzy_storage.c
index 569889660..d42dffdce 100644
--- a/src/fuzzy_storage.c
+++ b/src/fuzzy_storage.c
@@ -1332,7 +1332,8 @@ rspamd_fuzzy_process_command(struct fuzzy_session *session)
}
}
else if (cmd->cmd == FUZZY_STAT) {
- result.v1.prob = 1.0f;
+ /* Store approximation (if needed) */
+ result.v1.prob = session->ctx->stat.fuzzy_hashes;
/* Store high qword in value and low qword in flag */
result.v1.value = (gint32) ((guint64) session->ctx->stat.fuzzy_hashes >> 32);
result.v1.flag = (guint32) (session->ctx->stat.fuzzy_hashes & G_MAXUINT32);
More information about the Commits
mailing list