From 69978615370266e53b86d73835fcf7f665b73d6d Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Tue, 21 Nov 2023 16:26:36 +0000 Subject: [PATCH] [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); -- 2.39.5