commit 639ec37: Address PR review comments
ssturges
ststurge at cisco.com
Fri Jan 28 19:49:06 UTC 2022
Author: ssturges
Date: 2022-01-27 17:14:57 -0500
URL: https://github.com/rspamd/rspamd/commit/639ec37769c72a45f56b4af5c078fdcc737860e9
Address PR review comments
---
src/libserver/rspamd_symcache.c | 4 ++--
src/lua/lua_config.c | 6 +++---
src/rspamadm/configdump.c | 7 ++++---
3 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/src/libserver/rspamd_symcache.c b/src/libserver/rspamd_symcache.c
index 21804d543..7be447957 100644
--- a/src/libserver/rspamd_symcache.c
+++ b/src/libserver/rspamd_symcache.c
@@ -3387,7 +3387,7 @@ rspamd_symcache_set_symbol_flags (struct rspamd_symcache *cache,
void
rspamd_symcache_get_symbol_details(struct rspamd_symcache *cache,
const gchar *symbol,
- const ucl_object_t *this_sym_ucl)
+ ucl_object_t *this_sym_ucl)
{
struct rspamd_symcache_item *item;
@@ -3854,4 +3854,4 @@ rspamd_symcache_enable_profile (struct rspamd_task *task)
msg_debug_cache_task ("enable profiling of symbols for task");
checkpoint->profile = TRUE;
}
-}
\ No newline at end of file
+}
diff --git a/src/lua/lua_config.c b/src/lua/lua_config.c
index d66af2d0c..0ce93164d 100644
--- a/src/lua/lua_config.c
+++ b/src/lua/lua_config.c
@@ -2899,12 +2899,12 @@ lua_config_newindex (lua_State *L)
}
lua_pop (L, 1);
if (group) {
- if (sym->flags & RSPAMD_SYMBOL_FLAG_UNGROUPPED)
- {
+ if (sym->flags & RSPAMD_SYMBOL_FLAG_UNGROUPPED) {
/* Unset the "ungrouped" group */
sym->gr = NULL;
}
- /* Add the group */
+ /* Add the group. If the symbol was ungrouped, this will
+ * clear RSPAMD_SYMBOL_FLAG_UNGROUPPED from the flags. */
rspamd_config_add_symbol_group (cfg, name, group);
}
}
diff --git a/src/rspamadm/configdump.c b/src/rspamadm/configdump.c
index 577d05581..99a246538 100644
--- a/src/rspamadm/configdump.c
+++ b/src/rspamadm/configdump.c
@@ -330,6 +330,7 @@ rspamadm_configdump (gint argc, gchar **argv, const struct rspamadm_command *cmd
ucl_object_fromdouble (s->score),
"score", strlen ("score"),
false);
+
ucl_object_insert_key (this_sym_ucl,
ucl_object_fromstring (s->description),
"description", strlen ("description"), false);
@@ -368,17 +369,17 @@ rspamadm_configdump (gint argc, gchar **argv, const struct rspamadm_command *cmd
ucl_object_t *add_groups = ucl_object_typed_new (UCL_ARRAY);
guint j;
struct rspamd_symbols_group *add_gr;
- bool one_extra = false;
+ bool has_extra_groups = false;
PTR_ARRAY_FOREACH (s->groups, j, add_gr) {
if (add_gr->name && strcmp (add_gr->name, gr_name) != 0) {
ucl_array_append (add_groups,
ucl_object_fromstring (add_gr->name));
- one_extra = true;
+ has_extra_groups = true;
}
}
- if (one_extra == true) {
+ if (has_extra_groups == true) {
ucl_object_insert_key (this_sym_ucl,
add_groups,
"groups", strlen ("groups"),
More information about the Commits
mailing list