From 1f8e4827f0c4ea5b91736d6c1926318151343461 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Sun, 21 Aug 2022 20:26:09 +0100 Subject: [PATCH] [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, " -- 2.39.5