commit ff3f569: [Minor] Emit keypair on fuzzystat command

Vsevolod Stakhov vsevolod at rspamd.com
Wed Jan 4 19:56:04 UTC 2023


Author: Vsevolod Stakhov
Date: 2023-01-04 11:37:47 +0000
URL: https://github.com/rspamd/rspamd/commit/ff3f5692fa1fc1ac105cee876bffaf9b4e2a0c99

[Minor] Emit keypair on fuzzystat command

---
 src/fuzzy_storage.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/fuzzy_storage.c b/src/fuzzy_storage.c
index 8c721d487..76072ddcd 100644
--- a/src/fuzzy_storage.c
+++ b/src/fuzzy_storage.c
@@ -1848,7 +1848,7 @@ rspamd_fuzzy_stat_to_ucl (struct rspamd_fuzzy_storage_ctx *ctx, gboolean ip_stat
 {
 	struct fuzzy_key_stat *key_stat;
 	GHashTableIter it;
-	struct fuzzy_key *key;
+	struct fuzzy_key *fuzzy_key;
 	ucl_object_t *obj, *keys_obj, *elt, *ip_elt, *ip_cur;
 	gpointer k, v;
 	gint i;
@@ -1860,8 +1860,8 @@ rspamd_fuzzy_stat_to_ucl (struct rspamd_fuzzy_storage_ctx *ctx, gboolean ip_stat
 	g_hash_table_iter_init (&it, ctx->keys);
 
 	while (g_hash_table_iter_next (&it, &k, &v)) {
-		key = v;
-		key_stat = key->stat;
+		fuzzy_key = v;
+		key_stat = fuzzy_key->stat;
 
 		if (key_stat) {
 			rspamd_snprintf (keyname, sizeof (keyname), "%8bs", k);
@@ -1879,10 +1879,11 @@ rspamd_fuzzy_stat_to_ucl (struct rspamd_fuzzy_storage_ctx *ctx, gboolean ip_stat
 					ucl_object_insert_key (ip_elt, ip_cur,
 							rspamd_inet_address_to_string (k), 0, true);
 				}
-
 				ucl_object_insert_key (elt, ip_elt, "ips", 0, false);
 			}
 
+			ucl_object_insert_key (elt, rspamd_keypair_to_ucl (fuzzy_key->key, FALSE),
+				"keypair", 0, false);
 			ucl_object_insert_key (keys_obj, elt, keyname, 0, true);
 		}
 	}


More information about the Commits mailing list