summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/libserver/symbols_cache.h1
-rw-r--r--src/lua/lua_config.c4
2 files changed, 5 insertions, 0 deletions
diff --git a/src/libserver/symbols_cache.h b/src/libserver/symbols_cache.h
index 4e1c10dc5..2657b07cc 100644
--- a/src/libserver/symbols_cache.h
+++ b/src/libserver/symbols_cache.h
@@ -43,6 +43,7 @@ enum rspamd_symbol_type {
SYMBOL_TYPE_NOSTAT = (1 << 11), /* Skip as statistical symbol */
SYMBOL_TYPE_IDEMPOTENT = (1 << 12), /* Symbol cannot change metric */
SYMBOL_TYPE_SQUEEZED = (1 << 13), /* Symbol is squeezed inside Lua */
+ SYMBOL_TYPE_TRIVIAL = (1 << 14), /* Symbol is trivial */
};
/**
diff --git a/src/lua/lua_config.c b/src/lua/lua_config.c
index 84062d46b..35b7dc332 100644
--- a/src/lua/lua_config.c
+++ b/src/lua/lua_config.c
@@ -205,6 +205,7 @@ LUA_FUNCTION_DEF (config, get_classifier);
* + `empty` if symbol can be called for empty messages
* + `skip` if symbol should be skipped now
* + `nostat` if symbol should be excluded from stat tokens
+ * + `trivial` symbol is trivial (e.g. no network requests)
* - `parent`: id of parent symbol (useful for virtual symbols)
*
* @return {number} id of symbol registered
@@ -1568,6 +1569,9 @@ lua_parse_symbol_flags (const gchar *str)
if (strstr (str, "squeezed") != NULL) {
ret |= SYMBOL_TYPE_SQUEEZED;
}
+ if (strstr (str, "trivial") != NULL) {
+ ret |= SYMBOL_TYPE_TRIVIAL;
+ }
}
return ret;