diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-12-16 15:30:55 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-12-16 15:30:55 +0000 |
commit | 7ad859ff6b7d9e3d97b768616f9a7d415975955d (patch) | |
tree | d5faae693026dcb8928ba82db89d013e32d1cef5 | |
parent | e383fd8e4795ea6a24d28cd92be4bac79a91110d (diff) | |
download | rspamd-7ad859ff6b7d9e3d97b768616f9a7d415975955d.tar.gz rspamd-7ad859ff6b7d9e3d97b768616f9a7d415975955d.zip |
Show storage id in fuzzy stat command
-rw-r--r-- | src/fuzzy_storage.c | 5 | ||||
-rw-r--r-- | src/libserver/rspamd_control.c | 8 | ||||
-rw-r--r-- | src/libserver/rspamd_control.h | 2 |
3 files changed, 15 insertions, 0 deletions
diff --git a/src/fuzzy_storage.c b/src/fuzzy_storage.c index bd9337a54..c6b2a3be0 100644 --- a/src/fuzzy_storage.c +++ b/src/fuzzy_storage.c @@ -26,6 +26,7 @@ * Rspamd fuzzy storage server */ +#include <libserver/rspamd_control.h> #include "config.h" #include "util.h" #include "rspamd.h" @@ -856,6 +857,10 @@ rspamd_fuzzy_storage_stat (struct rspamd_main *rspamd_main, else { rep.reply.fuzzy_stat.status = 0; + memcpy (rep.reply.fuzzy_stat.storage_id, + rspamd_fuzzy_backend_id (ctx->backend), + sizeof (rep.reply.fuzzy_stat.storage_id)); + /* Iterate over all keys */ obj = ucl_object_typed_new (UCL_OBJECT); g_hash_table_iter_init (&it, ctx->keys); diff --git a/src/libserver/rspamd_control.c b/src/libserver/rspamd_control.c index df9746abf..2aab37b58 100644 --- a/src/libserver/rspamd_control.c +++ b/src/libserver/rspamd_control.c @@ -251,6 +251,14 @@ rspamd_control_write_reply (struct rspamd_control_session *session) ucl_parser_free (parser); } + + ucl_object_insert_key (cur, + ucl_object_fromlstring ( + elt->reply.reply.fuzzy_stat.storage_id, + MEMPOOL_UID_LEN - 1), + "id", + 0, + false); } else { ucl_object_insert_key (cur, diff --git a/src/libserver/rspamd_control.h b/src/libserver/rspamd_control.h index 2f864fd5a..a15ace0d6 100644 --- a/src/libserver/rspamd_control.h +++ b/src/libserver/rspamd_control.h @@ -26,6 +26,7 @@ #define RSPAMD_RSPAMD_CONTROL_H #include "config.h" +#include "mem_pool.h" #include <event.h> struct rspamd_main; @@ -94,6 +95,7 @@ struct rspamd_control_reply { } hs_loaded; struct { guint status; + gchar storage_id[MEMPOOL_UID_LEN]; } fuzzy_stat; } reply; }; |