commit 1f8e482: [Minor] Add timeout augmentation to fuzzy_check plugin
Vsevolod Stakhov
vsevolod at rspamd.com
Sun Aug 21 19:28:03 UTC 2022
Author: Vsevolod Stakhov
Date: 2022-08-21 20:26:09 +0100
URL: https://github.com/rspamd/rspamd/commit/1f8e4827f0c4ea5b91736d6c1926318151343461 (HEAD -> master)
[Minor] Add timeout augmentation to fuzzy_check plugin
---
src/plugins/fuzzy_check.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/src/plugins/fuzzy_check.c b/src/plugins/fuzzy_check.c
index 864187cc7..3f54f0aac 100644
--- a/src/plugins/fuzzy_check.c
+++ b/src/plugins/fuzzy_check.c
@@ -607,11 +607,20 @@ fuzzy_parse_rule (struct rspamd_config *cfg, const ucl_object_t *obj,
g_ptr_array_add (fuzzy_module_ctx->fuzzy_rules, rule);
if (rule->symbol != fuzzy_module_ctx->default_symbol) {
- rspamd_symcache_add_symbol (cfg->cache, rule->symbol,
+ int vid = rspamd_symcache_add_symbol (cfg->cache, rule->symbol,
0,
NULL, NULL,
SYMBOL_TYPE_VIRTUAL | SYMBOL_TYPE_FINE,
cb_id);
+
+ if (rule->io_timeout > 0) {
+ char timeout_buf[32];
+ rspamd_snprintf(timeout_buf, sizeof(timeout_buf), "%f",
+ rule->io_timeout);
+ rspamd_symcache_add_symbol_augmentation(cfg->cache,
+ vid, "timeout",
+ timeout_buf);
+ }
}
msg_info_config ("added fuzzy rule %s, key: %*xs, "
More information about the Commits
mailing list