From ff3f5692fa1fc1ac105cee876bffaf9b4e2a0c99 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Wed, 4 Jan 2023 11:37:47 +0000 Subject: [PATCH] [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); } } -- 2.39.5