gboolean check = TRUE;
const gdouble slow_diff_limit = 1e5;
- if (item->type & (SYMBOL_TYPE_NORMAL|SYMBOL_TYPE_CALLBACK)) {
+ if (item->func) {
g_assert (item->func != NULL);
/* Check has been started */
}
}
- ret = rspamd_symbols_cache_add_symbol (cfg->cache,
- name,
- priority,
- lua_metric_symbol_callback,
- cd,
- type,
- parent);
+ if (ref != -1) {
+ ret = rspamd_symbols_cache_add_symbol (cfg->cache,
+ name,
+ priority,
+ lua_metric_symbol_callback,
+ cd,
+ type,
+ parent);
+ }
+ else {
+ ret = rspamd_symbols_cache_add_symbol (cfg->cache,
+ name,
+ priority,
+ NULL,
+ cd,
+ type,
+ parent);
+ }
rspamd_mempool_add_destructor (cfg->cfg_pool,
(rspamd_mempool_destruct_t)lua_destroy_cfg_symbol,
cd);
ret = SYMBOL_TYPE_NORMAL;
}
else if (strcmp (str, "prefilter") == 0) {
- ret = SYMBOL_TYPE_PREFILTER;
+ ret = SYMBOL_TYPE_PREFILTER|SYMBOL_TYPE_GHOST;
}
else if (strcmp (str, "postfilter") == 0) {
- ret = SYMBOL_TYPE_POSTFILTER;
+ ret = SYMBOL_TYPE_POSTFILTER|SYMBOL_TYPE_GHOST;
}
else {
msg_warn ("bad type: %s", str);