"description", 0, false);
}
- if (rspamd_symbols_cache_stat_symbol (session->ctx->cfg->cache,
+ if (rspamd_symcache_stat_symbol (session->ctx->cfg->cache,
sym->name, &freq, &freq_dev, &tm, NULL)) {
ucl_object_insert_key (sym_obj,
ucl_object_fromdouble (freq),
{
struct rspamd_controller_session *session = conn_ent->ud;
ucl_object_t *top;
- struct symbols_cache *cache;
+ struct rspamd_symcache *cache;
if (!rspamd_controller_check_password (conn_ent, session, msg, FALSE)) {
return 0;
cache = session->ctx->cfg->cache;
if (cache != NULL) {
- top = rspamd_symbols_cache_counters (cache);
+ top = rspamd_symcache_counters (cache);
rspamd_controller_send_ucl (conn_ent, top);
ucl_object_unref (top);
}
rspamd_upstreams_library_config (worker->srv->cfg, worker->srv->cfg->ups_ctx,
ctx->ev_base, ctx->resolver->r);
- rspamd_symbols_cache_start_refresh (worker->srv->cfg->cache, ctx->ev_base,
+ rspamd_symcache_start_refresh (worker->srv->cfg->cache, ctx->ev_base,
worker);
rspamd_stat_init (worker->srv->cfg, ctx->ev_base);
/* Process cache item */
if (task->cfg->cache) {
- rspamd_symbols_cache_inc_frequency (task->cfg->cache, symbol);
+ rspamd_symcache_inc_frequency (task->cfg->cache, symbol);
}
return s;
#define RSPAMD_FILTER_H
#include "config.h"
-#include "symbols_cache.h"
+#include "rspamd_symcache.h"
#include "task.h"
#include "khash.h"
${CMAKE_CURRENT_SOURCE_DIR}/re_cache.c
${CMAKE_CURRENT_SOURCE_DIR}/roll_history.c
${CMAKE_CURRENT_SOURCE_DIR}/spf.c
- ${CMAKE_CURRENT_SOURCE_DIR}/symbols_cache.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/rspamd_symcache.c
${CMAKE_CURRENT_SOURCE_DIR}/task.c
${CMAKE_CURRENT_SOURCE_DIR}/url.c
${CMAKE_CURRENT_SOURCE_DIR}/worker_util.c)
#include "config.h"
#include "mem_pool.h"
#include "upstream.h"
-#include "symbols_cache.h"
+#include "rspamd_symcache.h"
#include "cfg_rcl.h"
#include "ucl.h"
#include "regexp.h"
gdouble monitored_interval; /**< interval between monitored checks */
gboolean disable_monitored; /**< disable monitoring completely */
- struct symbols_cache *cache; /**< symbols cache object */
+ struct rspamd_symcache *cache; /**< symbols cache object */
gchar *cache_filename; /**< filename of cache file */
gdouble cache_reload_time; /**< how often cache reload should be performed */
gchar * checksum; /**< real checksum of config file */
composite);
if (new) {
- rspamd_symbols_cache_add_symbol (cfg->cache, composite_name, 0,
+ rspamd_symcache_add_symbol (cfg->cache, composite_name, 0,
NULL, NULL, SYMBOL_TYPE_COMPOSITE, -1);
}
cfg->lua_thread_pool = lua_thread_pool_new (cfg->lua_state);
}
- cfg->cache = rspamd_symbols_cache_new (cfg);
+ cfg->cache = rspamd_symcache_new (cfg);
cfg->ups_ctx = rspamd_upstreams_library_init ();
cfg->re_cache = rspamd_re_cache_new ();
cfg->doc_strings = ucl_object_typed_new (UCL_OBJECT);
g_list_free (cfg->classifiers);
g_list_free (cfg->workers);
- rspamd_symbols_cache_destroy (cfg->cache);
+ rspamd_symcache_destroy (cfg->cache);
ucl_object_unref (cfg->rcl_obj);
ucl_object_unref (cfg->config_comments);
ucl_object_unref (cfg->doc_strings);
lua_settop (L, err_idx - 1);
/* Init config cache */
- rspamd_symbols_cache_init (cfg->cache);
+ rspamd_symcache_init (cfg->cache);
/* Init re cache */
rspamd_re_cache_init (cfg->re_cache, cfg);
ret = FALSE;
}
- ret = rspamd_symbols_cache_validate (cfg->cache, cfg, FALSE) && ret;
+ ret = rspamd_symcache_validate (cfg->cache, cfg, FALSE) && ret;
}
if (opts & RSPAMD_CONFIG_INIT_PRELOAD_MAPS) {
struct rspamd_config *cfg = ud;
/* Actually, statistics should act like any ordinary symbol */
- rspamd_symbols_cache_add_symbol (cfg->cache, key, 0, NULL, NULL,
- SYMBOL_TYPE_CLASSIFIER|SYMBOL_TYPE_NOSTAT, -1);
+ rspamd_symcache_add_symbol (cfg->cache, key, 0, NULL, NULL,
+ SYMBOL_TYPE_CLASSIFIER | SYMBOL_TYPE_NOSTAT, -1);
}
void
task = cd->task;
if (!isset (cd->checked, cd->composite->id * 2)) {
- if (rspamd_symbols_cache_is_checked (cd->task, cd->task->cfg->cache,
+ if (rspamd_symcache_is_checked (cd->task, cd->task->cfg->cache,
key)) {
msg_debug_composites ("composite %s is checked in symcache but not "
"in composites bitfield", cd->composite->sym);
struct rspamd_dns_request_ud *reqdata = (struct rspamd_dns_request_ud *)arg;
if (reqdata->item) {
- rspamd_symbols_cache_set_cur_item (reqdata->task, reqdata->item);
+ rspamd_symcache_set_cur_item (reqdata->task, reqdata->item);
}
if (reqdata->reply) {
task->dns_requests ++;
reqdata->task = task;
- reqdata->item = rspamd_symbols_cache_get_cur_item (task);
+ reqdata->item = rspamd_symcache_get_cur_item (task);
if (reqdata->item) {
/* We are inside some session */
i = 0;
kh_foreach_value_ptr (mres->symbols, sym, {
- id = rspamd_symbols_cache_find_symbol (task->cfg->cache,
+ id = rspamd_symcache_find_symbol (task->cfg->cache,
sym->name);
if (id >= 0) {
#include "util.h"
#include "rspamd.h"
#include "message.h"
-#include "symbols_cache.h"
+#include "rspamd_symcache.h"
#include "cfg_file.h"
#include "lua/lua_common.h"
#include "unix-std.h"
static const guchar rspamd_symbols_cache_magic[8] = {'r', 's', 'c', 2, 0, 0, 0, 0 };
-static gint rspamd_symbols_cache_find_filter (struct symbols_cache *cache,
+static gint rspamd_symbols_cache_find_filter (struct rspamd_symcache *cache,
const gchar *name);
struct rspamd_symbols_cache_header {
ref_entry_t ref;
};
-struct symbols_cache {
+struct rspamd_symcache {
/* Hash table for fast access */
GHashTable *items_by_symbol;
+ GPtrArray *items_by_id;
struct symbols_cache_order *items_by_order;
GPtrArray *filters;
GPtrArray *prefilters;
gdouble stddev_frequency;
};
+struct rspamd_symcache_dynamic_item {
+ guint16 start_msec; /* Relative to task time */
+ unsigned started:1;
+ unsigned finished:1;
+ /* unsigned pad:14; */
+ guint32 async_events;
+};
+
struct rspamd_symcache_item {
/* This block is likely shared */
struct item_stat *st;
guint64 last_count;
- /* Per process counter */
- gdouble start_ticks;
- guint async_events;
struct rspamd_counter_data *cd;
gchar *symbol;
enum rspamd_symbol_type type;
RSPAMD_CACHE_PASS_DONE,
};
-struct cache_bits {
-#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
- _Alignas(guint64) guint8 *started;
- _Alignas(guint64) guint8 *finished;
-#else
-#warning "outdated compiler, please use C11 compiler"
- guint8 *started;
- guint8 *finished;
-#endif
-};
-
struct cache_savepoint {
enum rspamd_cache_savepoint_stage pass;
guint version;
gdouble lim;
struct rspamd_symcache_item *cur_item;
- struct cache_bits *cur_bits;
struct symbols_cache_order *order;
-
- struct cache_bits prefilters;
- struct cache_bits filters;
- struct cache_bits postfilters;
- struct cache_bits idempotent;
+ GArray *dynamic_items;
};
struct rspamd_cache_refresh_cbdata {
gdouble last_resort;
struct event resort_ev;
- struct symbols_cache *cache;
+ struct rspamd_symcache *cache;
struct rspamd_worker *w;
struct event_base *ev_base;
};
/ (t > TIME_ALPHA ? t : TIME_ALPHA))
static gboolean rspamd_symbols_cache_check_symbol (struct rspamd_task *task,
- struct symbols_cache *cache,
+ struct rspamd_symcache *cache,
struct rspamd_symcache_item *item,
struct cache_savepoint *checkpoint);
static gboolean rspamd_symbols_cache_check_deps (struct rspamd_task *task,
- struct symbols_cache *cache,
+ struct rspamd_symcache *cache,
struct rspamd_symcache_item *item,
struct cache_savepoint *checkpoint,
guint recursion,
gboolean check_only);
static void rspamd_symbols_cache_disable_symbol_checkpoint (struct rspamd_task *task,
- struct symbols_cache *cache, const gchar *symbol);
+ struct rspamd_symcache *cache, const gchar *symbol);
static void rspamd_symbols_cache_enable_symbol_checkpoint (struct rspamd_task *task,
- struct symbols_cache *cache, const gchar *symbol);
+ struct rspamd_symcache *cache, const gchar *symbol);
static void rspamd_symbols_cache_disable_all_symbols (struct rspamd_task *task,
- struct symbols_cache *cache);
+ struct rspamd_symcache *cache);
static void
rspamd_symbols_cache_order_dtor (gpointer p)
}
static struct symbols_cache_order *
-rspamd_symbols_cache_order_new (struct symbols_cache *cache,
+rspamd_symbols_cache_order_new (struct rspamd_symcache *cache,
gsize nelts)
{
struct symbols_cache_order *ord;
return ord;
}
+static inline struct rspamd_symcache_item*
+rspamd_symcache_get_dynamic (struct cache_savepoint *checkpoint,
+ struct rspamd_symcache_item *item)
+{
+ return &g_array_index (checkpoint->dynamic_items,
+ struct rspamd_symcache_item, item->id);
+}
+
static gint
postfilters_cmp (const void *p1, const void *p2, gpointer ud)
{
{
const struct rspamd_symcache_item *i1 = *(struct rspamd_symcache_item **)p1,
*i2 = *(struct rspamd_symcache_item **)p2;
- struct symbols_cache *cache = ud;
+ struct rspamd_symcache *cache = ud;
double w1, w2;
double weight1, weight2;
double f1 = 0, f2 = 0, t1, t2, avg_freq, avg_weight;
}
static void
-rspamd_symbols_cache_tsort_visit (struct symbols_cache *cache,
+rspamd_symbols_cache_tsort_visit (struct rspamd_symcache *cache,
struct rspamd_symcache_item *it,
guint cur_order)
{
}
static void
-rspamd_symbols_cache_resort (struct symbols_cache *cache)
+rspamd_symbols_cache_resort (struct rspamd_symcache *cache)
{
struct symbols_cache_order *ord;
guint i;
/* Sort items in logical order */
static void
-rspamd_symbols_cache_post_init (struct symbols_cache *cache)
+rspamd_symbols_cache_post_init (struct rspamd_symcache *cache)
{
struct rspamd_symcache_item *it, *dit;
struct cache_dependency *dep, *rdep;
else {
msg_debug_cache ("delayed between %s(%d) -> %s", ddep->from,
it->id, ddep->to);
- rspamd_symbols_cache_add_dependency (cache, it->id, ddep->to);
+ rspamd_symcache_add_dependency (cache, it->id, ddep->to);
}
cur = g_list_next (cur);
}
static gboolean
-rspamd_symbols_cache_load_items (struct symbols_cache *cache, const gchar *name)
+rspamd_symbols_cache_load_items (struct rspamd_symcache *cache, const gchar *name)
{
struct rspamd_symbols_cache_header *hdr;
struct stat st;
#define ROUND_DOUBLE(x) (floor((x) * 100.0) / 100.0)
static gboolean
-rspamd_symbols_cache_save_items (struct symbols_cache *cache, const gchar *name)
+rspamd_symbols_cache_save_items (struct rspamd_symcache *cache, const gchar *name)
{
struct rspamd_symbols_cache_header hdr;
ucl_object_t *top, *elt, *freq;
#undef ROUND_DOUBLE
gint
-rspamd_symbols_cache_add_symbol (struct symbols_cache *cache,
- const gchar *name,
- gint priority,
- symbol_func_t func,
- gpointer user_data,
- enum rspamd_symbol_type type,
- gint parent)
+rspamd_symcache_add_symbol (struct rspamd_symcache *cache,
+ const gchar *name,
+ gint priority,
+ symbol_func_t func,
+ gpointer user_data,
+ enum rspamd_symbol_type type,
+ gint parent)
{
struct rspamd_symcache_item *item = NULL;
g_assert (parent == -1);
if (item->type & SYMBOL_TYPE_PREFILTER) {
- item->id = cache->prefilters->len;
g_ptr_array_add (cache->prefilters, item);
}
else if (item->type & SYMBOL_TYPE_IDEMPOTENT) {
- item->id = cache->idempotent->len;
g_ptr_array_add (cache->idempotent, item);
}
else if (item->type & SYMBOL_TYPE_POSTFILTER) {
- item->id = cache->postfilters->len;
g_ptr_array_add (cache->postfilters, item);
}
else {
- item->id = cache->filters->len;
item->is_filter = TRUE;
g_ptr_array_add (cache->filters, item);
}
+ item->id = cache->items_by_id->len;
+ g_ptr_array_add (cache->items_by_id, item);
+
item->specific.normal.func = func;
item->specific.normal.user_data = user_data;
item->specific.normal.condition_cb = -1;
* - composite symbol
*/
if (item->type & SYMBOL_TYPE_COMPOSITE) {
- item->id = cache->composites->len;
item->specific.normal.condition_cb = -1;
g_ptr_array_add (cache->composites, item);
+
+ item->id = cache->items_by_id->len;
+ g_ptr_array_add (cache->items_by_id, item);
}
else if (item->type & SYMBOL_TYPE_CLASSIFIER) {
/* Treat it as normal symbol to allow enable/disable */
- item->id = cache->filters->len;
- g_ptr_array_add (cache->filters, item);
+ item->id = cache->items_by_id->len;
+ g_ptr_array_add (cache->items_by_id, item);
+
item->is_filter = TRUE;
item->specific.normal.func = NULL;
item->specific.normal.user_data = NULL;
}
void
-rspamd_symbols_cache_set_peak_callback (struct symbols_cache *cache,
- gint cbref)
+rspamd_symcache_set_peak_callback (struct rspamd_symcache *cache,
+ gint cbref)
{
g_assert (cache != NULL);
}
gboolean
-rspamd_symbols_cache_add_condition_delayed (struct symbols_cache *cache,
- const gchar *sym, lua_State *L, gint cbref)
+rspamd_symcache_add_condition_delayed (struct rspamd_symcache *cache,
+ const gchar *sym, lua_State *L, gint cbref)
{
struct delayed_cache_condition *ncond;
}
void
-rspamd_symbols_cache_save (struct symbols_cache *cache)
+rspamd_symcache_save (struct rspamd_symcache *cache)
{
if (cache != NULL) {
}
void
-rspamd_symbols_cache_destroy (struct symbols_cache *cache)
+rspamd_symcache_destroy (struct rspamd_symcache *cache)
{
GList *cur;
struct delayed_cache_dependency *ddep;
struct delayed_cache_condition *dcond;
if (cache != NULL) {
- rspamd_symbols_cache_save (cache);
+ rspamd_symcache_save (cache);
if (cache->delayed_deps) {
cur = cache->delayed_deps;
}
g_hash_table_destroy (cache->items_by_symbol);
+ g_ptr_array_free (cache->items_by_order, TRUE);
rspamd_mempool_delete (cache->static_pool);
g_ptr_array_free (cache->filters, TRUE);
g_ptr_array_free (cache->prefilters, TRUE);
}
}
-struct symbols_cache*
-rspamd_symbols_cache_new (struct rspamd_config *cfg)
+struct rspamd_symcache*
+rspamd_symcache_new (struct rspamd_config *cfg)
{
- struct symbols_cache *cache;
+ struct rspamd_symcache *cache;
- cache = g_malloc0 (sizeof (struct symbols_cache));
+ cache = g_malloc0 (sizeof (struct rspamd_symcache));
cache->static_pool =
rspamd_mempool_new (rspamd_mempool_suggest_size (), "symcache");
cache->items_by_symbol = g_hash_table_new (rspamd_str_hash,
rspamd_str_equal);
+ cache->items_by_order = g_ptr_array_new ();
cache->filters = g_ptr_array_new ();
cache->prefilters = g_ptr_array_new ();
cache->postfilters = g_ptr_array_new ();
}
gboolean
-rspamd_symbols_cache_init (struct symbols_cache* cache)
+rspamd_symcache_init (struct rspamd_symcache *cache)
{
gboolean res;
{
struct rspamd_symcache_item *item = v, *parent;
struct rspamd_config *cfg;
- struct symbols_cache *cache = (struct symbols_cache *)ud;
+ struct rspamd_symcache *cache = (struct rspamd_symcache *)ud;
struct rspamd_symbol *s;
gboolean skipped, ghost;
gint p1, p2;
static void
rspamd_symbols_cache_metric_validate_cb (gpointer k, gpointer v, gpointer ud)
{
- struct symbols_cache *cache = (struct symbols_cache *)ud;
+ struct rspamd_symcache *cache = (struct rspamd_symcache *)ud;
const gchar *sym = k;
struct rspamd_symbol *s = (struct rspamd_symbol *)v;
gdouble weight;
}
gboolean
-rspamd_symbols_cache_validate (struct symbols_cache *cache,
- struct rspamd_config *cfg,
- gboolean strict)
+rspamd_symcache_validate (struct rspamd_symcache *cache,
+ struct rspamd_config *cfg,
+ gboolean strict)
{
struct rspamd_symcache_item *item;
GHashTableIter it;
static gboolean
rspamd_symbols_cache_check_symbol (struct rspamd_task *task,
- struct symbols_cache *cache,
+ struct rspamd_symcache *cache,
struct rspamd_symcache_item *item,
struct cache_savepoint *checkpoint)
{
static gboolean
rspamd_symbols_cache_check_deps (struct rspamd_task *task,
- struct symbols_cache *cache,
+ struct rspamd_symcache *cache,
struct rspamd_symcache_item *item,
struct cache_savepoint *checkpoint,
guint recursion,
static struct cache_savepoint *
rspamd_symbols_cache_make_checkpoint (struct rspamd_task *task,
- struct symbols_cache *cache)
+ struct rspamd_symcache *cache)
{
struct cache_savepoint *checkpoint;
}
gboolean
-rspamd_symbols_cache_process_settings (struct rspamd_task *task,
- struct symbols_cache *cache)
+rspamd_symcache_process_settings (struct rspamd_task *task,
+ struct rspamd_symcache *cache)
{
const ucl_object_t *wl, *cur, *disabled, *enabled;
struct rspamd_symbols_group *gr;
}
gboolean
-rspamd_symbols_cache_process_symbols (struct rspamd_task * task,
- struct symbols_cache *cache, gint stage)
+rspamd_symcache_process_symbols (struct rspamd_task *task,
+ struct rspamd_symcache *cache, gint stage)
{
struct rspamd_symcache_item *item = NULL;
struct cache_savepoint *checkpoint;
}
if (stage == RSPAMD_TASK_STAGE_FILTERS) {
- return rspamd_symbols_cache_process_symbols (task, cache, stage);
+ return rspamd_symcache_process_symbols (task, cache, stage);
}
break;
if (stage == RSPAMD_TASK_STAGE_POST_FILTERS) {
- return rspamd_symbols_cache_process_symbols (task, cache, stage);
+ return rspamd_symcache_process_symbols (task, cache, stage);
}
break;
}
if (stage == RSPAMD_TASK_STAGE_IDEMPOTENT) {
- return rspamd_symbols_cache_process_symbols (task, cache, stage);
+ return rspamd_symcache_process_symbols (task, cache, stage);
}
break;
struct counters_cbdata {
ucl_object_t *top;
- struct symbols_cache *cache;
+ struct rspamd_symcache *cache;
};
#define ROUND_DOUBLE(x) (floor((x) * 100.0) / 100.0)
#undef ROUND_DOUBLE
ucl_object_t *
-rspamd_symbols_cache_counters (struct symbols_cache * cache)
+rspamd_symcache_counters (struct rspamd_symcache *cache)
{
ucl_object_t *top;
struct counters_cbdata cbd;
static void
rspamd_symbols_cache_call_peak_cb (struct event_base *ev_base,
- struct symbols_cache *cache,
+ struct rspamd_symcache *cache,
struct rspamd_symcache_item *item,
gdouble cur_value,
gdouble cur_err)
struct timeval tv;
gdouble tm;
struct rspamd_cache_refresh_cbdata *cbdata = ud;
- struct symbols_cache *cache;
+ struct rspamd_symcache *cache;
struct rspamd_symcache_item *item;
guint i;
gdouble cur_ticks;
}
void
-rspamd_symbols_cache_start_refresh (struct symbols_cache * cache,
- struct event_base *ev_base, struct rspamd_worker *w)
+rspamd_symcache_start_refresh (struct rspamd_symcache *cache,
+ struct event_base *ev_base, struct rspamd_worker *w)
{
struct timeval tv;
gdouble tm;
}
void
-rspamd_symbols_cache_inc_frequency (struct symbols_cache *cache,
- const gchar *symbol)
+rspamd_symcache_inc_frequency (struct rspamd_symcache *cache,
+ const gchar *symbol)
{
struct rspamd_symcache_item *item;
}
void
-rspamd_symbols_cache_add_dependency (struct symbols_cache *cache,
- gint id_from, const gchar *to)
+rspamd_symcache_add_dependency (struct rspamd_symcache *cache,
+ gint id_from, const gchar *to)
{
struct rspamd_symcache_item *source;
struct cache_dependency *dep;
}
void
-rspamd_symbols_cache_add_delayed_dependency (struct symbols_cache *cache,
- const gchar *from, const gchar *to)
+rspamd_symcache_add_delayed_dependency (struct rspamd_symcache *cache,
+ const gchar *from, const gchar *to)
{
struct delayed_cache_dependency *ddep;
}
gint
-rspamd_symbols_cache_find_symbol (struct symbols_cache *cache, const gchar *name)
+rspamd_symcache_find_symbol (struct rspamd_symcache *cache, const gchar *name)
{
struct rspamd_symcache_item *item;
}
gboolean
-rspamd_symbols_cache_stat_symbol (struct symbols_cache *cache,
- const gchar *name, gdouble *frequency, gdouble *freq_stddev,
- gdouble *tm, guint *nhits)
+rspamd_symcache_stat_symbol (struct rspamd_symcache *cache,
+ const gchar *name, gdouble *frequency, gdouble *freq_stddev,
+ gdouble *tm, guint *nhits)
{
struct rspamd_symcache_item *item;
}
static gint
-rspamd_symbols_cache_find_filter (struct symbols_cache *cache,
+rspamd_symbols_cache_find_filter (struct rspamd_symcache *cache,
const gchar *name)
{
struct rspamd_symcache_item *item;
}
const gchar *
-rspamd_symbols_cache_symbol_by_id (struct symbols_cache *cache,
- gint id)
+rspamd_symcache_symbol_by_id (struct rspamd_symcache *cache,
+ gint id)
{
struct rspamd_symcache_item *item;
}
guint
-rspamd_symbols_cache_stats_symbols_count (struct symbols_cache *cache)
+rspamd_symcache_stats_symbols_count (struct rspamd_symcache *cache)
{
g_assert (cache != NULL);
static void
rspamd_symbols_cache_disable_all_symbols (struct rspamd_task *task,
- struct symbols_cache *cache)
+ struct rspamd_symcache *cache)
{
struct cache_savepoint *checkpoint;
guint i;
static struct rspamd_symcache_item *
rspamd_symbols_cache_get_item_and_bits (struct rspamd_task *task,
- struct symbols_cache *cache,
+ struct rspamd_symcache *cache,
struct cache_savepoint *checkpoint,
const gchar *symbol,
struct cache_bits **bits)
static void
rspamd_symbols_cache_disable_symbol_checkpoint (struct rspamd_task *task,
- struct symbols_cache *cache, const gchar *symbol)
+ struct rspamd_symcache *cache, const gchar *symbol)
{
struct cache_savepoint *checkpoint;
struct rspamd_symcache_item *item;
static void
rspamd_symbols_cache_enable_symbol_checkpoint (struct rspamd_task *task,
- struct symbols_cache *cache, const gchar *symbol)
+ struct rspamd_symcache *cache, const gchar *symbol)
{
struct cache_savepoint *checkpoint;
struct rspamd_symcache_item *item;
}
struct rspamd_abstract_callback_data*
-rspamd_symbols_cache_get_cbdata (struct symbols_cache *cache,
- const gchar *symbol)
+rspamd_symcache_get_cbdata (struct rspamd_symcache *cache,
+ const gchar *symbol)
{
struct rspamd_symcache_item *item;
}
gboolean
-rspamd_symbols_cache_is_checked (struct rspamd_task *task,
- struct symbols_cache *cache, const gchar *symbol)
+rspamd_symcache_is_checked (struct rspamd_task *task,
+ struct rspamd_symcache *cache, const gchar *symbol)
{
struct cache_savepoint *checkpoint;
struct rspamd_symcache_item *item;
}
void
-rspamd_symbols_cache_disable_symbol (struct symbols_cache *cache,
- const gchar *symbol)
+rspamd_symcache_disable_symbol (struct rspamd_symcache *cache,
+ const gchar *symbol)
{
struct rspamd_symcache_item *item;
}
void
-rspamd_symbols_cache_enable_symbol (struct symbols_cache *cache,
- const gchar *symbol)
+rspamd_symcache_enable_symbol (struct rspamd_symcache *cache,
+ const gchar *symbol)
{
struct rspamd_symcache_item *item;
}
guint64
-rspamd_symbols_cache_get_cksum (struct symbols_cache *cache)
+rspamd_symcache_get_cksum (struct rspamd_symcache *cache)
{
g_assert (cache != NULL);
gboolean
-rspamd_symbols_cache_is_symbol_enabled (struct rspamd_task *task,
- struct symbols_cache *cache, const gchar *symbol)
+rspamd_symcache_is_symbol_enabled (struct rspamd_task *task,
+ struct rspamd_symcache *cache, const gchar *symbol)
{
struct cache_savepoint *checkpoint;
struct rspamd_symcache_item *item;
}
void
-rspamd_symbols_cache_foreach (struct symbols_cache *cache,
- void (*func)(gint , const gchar *, gint , gpointer ),
- gpointer ud)
+rspamd_symcache_foreach (struct rspamd_symcache *cache,
+ void (*func) (gint, const gchar *, gint, gpointer),
+ gpointer ud)
{
struct rspamd_symcache_item *item;
GHashTableIter it;
}
struct rspamd_symcache_item *
-rspamd_symbols_cache_get_cur_item (struct rspamd_task *task)
+rspamd_symcache_get_cur_item (struct rspamd_task *task)
{
struct cache_savepoint *checkpoint = task->checkpoint;
* @return
*/
struct rspamd_symcache_item *
-rspamd_symbols_cache_set_cur_item (struct rspamd_task *task,
- struct rspamd_symcache_item *item)
+rspamd_symcache_set_cur_item (struct rspamd_task *task,
+ struct rspamd_symcache_item *item)
{
struct cache_savepoint *checkpoint = task->checkpoint;
struct rspamd_symcache_item *ex;
* Finalize the current async element potentially calling its deps
*/
void
-rspamd_symbols_cache_finalize_item (struct rspamd_task *task,
- struct rspamd_symcache_item *item)
+rspamd_symcache_finalize_item (struct rspamd_task *task,
+ struct rspamd_symcache_item *item)
{
struct cache_savepoint *checkpoint = task->checkpoint;
struct cache_dependency *rdep;
const gchar *loc)
{
if (rspamd_symcache_item_async_dec_full (task, item, subsystem, loc) == 0) {
- rspamd_symbols_cache_finalize_item (task, item);
+ rspamd_symcache_finalize_item (task, item);
return TRUE;
}
struct rspamd_task;
struct rspamd_config;
-struct symbols_cache;
+struct rspamd_symcache;
struct rspamd_worker;
struct rspamd_symcache_item;
* Creates new cache structure
* @return
*/
-struct symbols_cache* rspamd_symbols_cache_new (struct rspamd_config *cfg);
+struct rspamd_symcache* rspamd_symcache_new (struct rspamd_config *cfg);
/**
* Remove the cache structure syncing data if needed
* @param cache
*/
-void rspamd_symbols_cache_destroy (struct symbols_cache *cache);
+void rspamd_symcache_destroy (struct rspamd_symcache *cache);
/**
* Saves symbols cache to disk if possible
* @param cache
*/
-void rspamd_symbols_cache_save (struct symbols_cache *cache);
+void rspamd_symcache_save (struct rspamd_symcache *cache);
/**
* Load symbols cache from file, must be called _after_ init_symbols_cache
*/
-gboolean rspamd_symbols_cache_init (struct symbols_cache* cache);
+gboolean rspamd_symcache_init (struct rspamd_symcache *cache);
/**
* Generic function to register a symbol
* @param type
* @param parent
*/
-gint rspamd_symbols_cache_add_symbol (struct symbols_cache *cache,
- const gchar *name,
- gint priority,
- symbol_func_t func,
- gpointer user_data,
- enum rspamd_symbol_type type,
- gint parent);
+gint rspamd_symcache_add_symbol (struct rspamd_symcache *cache,
+ const gchar *name,
+ gint priority,
+ symbol_func_t func,
+ gpointer user_data,
+ enum rspamd_symbol_type type,
+ gint parent);
/**
* Add callback to be executed whenever symbol has peak value
* @param cache
* @param cbref
*/
-void rspamd_symbols_cache_set_peak_callback (struct symbols_cache *cache,
- gint cbref);
+void rspamd_symcache_set_peak_callback (struct rspamd_symcache *cache,
+ gint cbref);
/**
* Add delayed condition to the specific symbol in cache. So symbol can be absent
* to the moment of addition
* @param cbref callback reference (returned by luaL_ref)
* @return TRUE if condition has been added
*/
-gboolean rspamd_symbols_cache_add_condition_delayed (struct symbols_cache *cache,
- const gchar *sym, lua_State *L, gint cbref);
+gboolean rspamd_symcache_add_condition_delayed (struct rspamd_symcache *cache,
+ const gchar *sym,
+ lua_State *L, gint cbref);
/**
* Find symbol in cache by id and returns its id resolving virtual symbols if
* @param name
* @return id of symbol or (-1) if a symbol has not been found
*/
-gint rspamd_symbols_cache_find_symbol (struct symbols_cache *cache,
- const gchar *name);
+gint rspamd_symcache_find_symbol (struct rspamd_symcache *cache,
+ const gchar *name);
/**
* Get statistics for a specific symbol
* @param tm
* @return
*/
-gboolean rspamd_symbols_cache_stat_symbol (struct symbols_cache *cache,
- const gchar *name, gdouble *frequency, gdouble *freq_stddev,
- gdouble *tm, guint *nhits);
+gboolean rspamd_symcache_stat_symbol (struct rspamd_symcache *cache,
+ const gchar *name,
+ gdouble *frequency,
+ gdouble *freq_stddev,
+ gdouble *tm,
+ guint *nhits);
/**
* Find symbol in cache by its id
* @param cache
* @param id
* @return symbol's name or NULL
*/
-const gchar * rspamd_symbols_cache_symbol_by_id (struct symbols_cache *cache,
- gint id);
+const gchar * rspamd_symcache_symbol_by_id (struct rspamd_symcache *cache,
+ gint id);
/**
* Returns number of symbols registered in symbols cache
* @param cache
* @return number of symbols in the cache
*/
-guint rspamd_symbols_cache_stats_symbols_count (struct symbols_cache *cache);
+guint rspamd_symcache_stats_symbols_count (struct rspamd_symcache *cache);
/**
* Call function for cached symbol using saved callback
* @param cache symbols cache
* @param saved_item pointer to currently saved item
*/
-gboolean rspamd_symbols_cache_process_symbols (struct rspamd_task *task,
- struct symbols_cache *cache, gint stage);
+gboolean rspamd_symcache_process_symbols (struct rspamd_task *task,
+ struct rspamd_symcache *cache,
+ gint stage);
/**
* Validate cache items against theirs weights defined in metrics
* @param cfg configuration
* @param strict do strict checks - symbols MUST be described in metrics
*/
-gboolean rspamd_symbols_cache_validate (struct symbols_cache *cache,
- struct rspamd_config *cfg,
- gboolean strict);
+gboolean rspamd_symcache_validate (struct rspamd_symcache *cache,
+ struct rspamd_config *cfg,
+ gboolean strict);
/**
* Return statistics about the cache as ucl object (array of objects one per item)
* @param cache
* @return
*/
-ucl_object_t *rspamd_symbols_cache_counters (struct symbols_cache * cache);
+ucl_object_t *rspamd_symcache_counters (struct rspamd_symcache *cache);
/**
* Start cache reloading
* @param cache
* @param ev_base
*/
-void rspamd_symbols_cache_start_refresh (struct symbols_cache * cache,
- struct event_base *ev_base, struct rspamd_worker *w);
+void rspamd_symcache_start_refresh (struct rspamd_symcache *cache,
+ struct event_base *ev_base,
+ struct rspamd_worker *w);
/**
* Increases counter for a specific symbol
* @param cache
* @param symbol
*/
-void rspamd_symbols_cache_inc_frequency (struct symbols_cache *cache,
- const gchar *symbol);
+void rspamd_symcache_inc_frequency (struct rspamd_symcache *cache,
+ const gchar *symbol);
/**
* Add dependency relation between two symbols identified by id (source) and
* @param id_from source symbol
* @param to destination name
*/
-void rspamd_symbols_cache_add_dependency (struct symbols_cache *cache,
- gint id_from, const gchar *to);
+void rspamd_symcache_add_dependency (struct rspamd_symcache *cache,
+ gint id_from, const gchar *to);
/**
* Add delayed dependency that is resolved on cache post-load routine
* @param from
* @param to
*/
-void rspamd_symbols_cache_add_delayed_dependency (struct symbols_cache *cache,
- const gchar *from, const gchar *to);
+void rspamd_symcache_add_delayed_dependency (struct rspamd_symcache *cache,
+ const gchar *from, const gchar *to);
/**
* Disable specific symbol in the cache
* @param cache
* @param symbol
*/
-void rspamd_symbols_cache_disable_symbol (struct symbols_cache *cache,
- const gchar *symbol);
+void rspamd_symcache_disable_symbol (struct rspamd_symcache *cache,
+ const gchar *symbol);
/**
* Enable specific symbol in the cache
* @param cache
* @param symbol
*/
-void rspamd_symbols_cache_enable_symbol (struct symbols_cache *cache,
- const gchar *symbol);
+void rspamd_symcache_enable_symbol (struct rspamd_symcache *cache,
+ const gchar *symbol);
/**
* Get abstract callback data for a symbol (or its parent symbol)
* @param cache cache object
* @param symbol symbol name
* @return abstract callback data or NULL if symbol is absent or has no data attached
*/
-struct rspamd_abstract_callback_data* rspamd_symbols_cache_get_cbdata (
- struct symbols_cache *cache, const gchar *symbol);
+struct rspamd_abstract_callback_data* rspamd_symcache_get_cbdata (
+ struct rspamd_symcache *cache, const gchar *symbol);
/**
* @param cache
* @return
*/
-gboolean rspamd_symbols_cache_process_settings (struct rspamd_task *task,
- struct symbols_cache *cache);
+gboolean rspamd_symcache_process_settings (struct rspamd_task *task,
+ struct rspamd_symcache *cache);
/**
* @param symbol
* @return
*/
-gboolean rspamd_symbols_cache_is_checked (struct rspamd_task *task,
- struct symbols_cache *cache, const gchar *symbol);
+gboolean rspamd_symcache_is_checked (struct rspamd_task *task,
+ struct rspamd_symcache *cache,
+ const gchar *symbol);
/**
* Returns checksum for all cache items
* @param cache
* @return
*/
-guint64 rspamd_symbols_cache_get_cksum (struct symbols_cache *cache);
+guint64 rspamd_symcache_get_cksum (struct rspamd_symcache *cache);
/**
* Checks if a symbols is enabled (not checked and conditions return true if present)
* @param symbol
* @return
*/
-gboolean rspamd_symbols_cache_is_symbol_enabled (struct rspamd_task *task,
- struct symbols_cache *cache, const gchar *symbol);
+gboolean rspamd_symcache_is_symbol_enabled (struct rspamd_task *task,
+ struct rspamd_symcache *cache,
+ const gchar *symbol);
/**
* Process specific function for each cache element (in order they are added)
* @param cache
* @param func
* @param ud
*/
-void rspamd_symbols_cache_foreach (struct symbols_cache *cache,
- void (*func)(gint /* id */, const gchar * /* name */,
- gint /* flags */, gpointer /* userdata */),
- gpointer ud);
+void rspamd_symcache_foreach (struct rspamd_symcache *cache,
+ void (*func) (gint /* id */, const gchar * /* name */,
+ gint /* flags */, gpointer /* userdata */),
+ gpointer ud);
/**
* Returns the current item being processed (if any)
* @param task
* @return
*/
-struct rspamd_symcache_item *rspamd_symbols_cache_get_cur_item (struct rspamd_task *task);
+struct rspamd_symcache_item *rspamd_symcache_get_cur_item (struct rspamd_task *task);
/**
* Replaces the current item being processed.
* @param item
* @return
*/
-struct rspamd_symcache_item *rspamd_symbols_cache_set_cur_item (struct rspamd_task *task,
- struct rspamd_symcache_item *item);
+struct rspamd_symcache_item *rspamd_symcache_set_cur_item (struct rspamd_task *task,
+ struct rspamd_symcache_item *item);
/**
* Finalize the current async element potentially calling its deps
*/
-void rspamd_symbols_cache_finalize_item (struct rspamd_task *task,
- struct rspamd_symcache_item *item);
+void rspamd_symcache_finalize_item (struct rspamd_task *task,
+ struct rspamd_symcache_item *item);
/*
* Increase number of async events pending for an item
break;
case RSPAMD_TASK_STAGE_PRE_FILTERS:
- rspamd_symbols_cache_process_symbols (task, task->cfg->cache,
+ rspamd_symcache_process_symbols (task, task->cfg->cache,
RSPAMD_TASK_STAGE_PRE_FILTERS);
break;
break;
case RSPAMD_TASK_STAGE_FILTERS:
- rspamd_symbols_cache_process_symbols (task, task->cfg->cache,
+ rspamd_symcache_process_symbols (task, task->cfg->cache,
RSPAMD_TASK_STAGE_FILTERS);
break;
break;
case RSPAMD_TASK_STAGE_POST_FILTERS:
- rspamd_symbols_cache_process_symbols (task, task->cfg->cache,
+ rspamd_symcache_process_symbols (task, task->cfg->cache,
RSPAMD_TASK_STAGE_POST_FILTERS);
if ((task->flags & RSPAMD_TASK_FLAG_LEARN_AUTO) &&
rspamd_make_composites (task);
break;
case RSPAMD_TASK_STAGE_IDEMPOTENT:
- rspamd_symbols_cache_process_symbols (task, task->cfg->cache,
+ rspamd_symcache_process_symbols (task, task->cfg->cache,
RSPAMD_TASK_STAGE_IDEMPOTENT);
break;
rt->redis_object_expanded, learned_key) == REDIS_OK) {
rspamd_session_add_event (task->s, rspamd_redis_fin, rt, M);
- rt->item = rspamd_symbols_cache_get_cur_item (task);
+ rt->item = rspamd_symcache_get_cur_item (task);
rt->has_event = TRUE;
if (rspamd_event_pending (&rt->timeout_event, EV_TIMEOUT)) {
}
rspamd_session_add_event (task->s, rspamd_redis_fin_learn, rt, M);
- rt->item = rspamd_symbols_cache_get_cur_item (task);
+ rt->item = rspamd_symcache_get_cur_item (task);
rt->has_event = TRUE;
/* Set timeout */
rspamd_redis_cache_fin,
rt,
M);
- rt->item = rspamd_symbols_cache_get_cur_item (task);
+ rt->item = rspamd_symcache_get_cur_item (task);
event_add (&rt->timeout_event, &tv);
rt->has_event = TRUE;
}
rt->ctx->redis_object, h, flag) == REDIS_OK) {
rspamd_session_add_event (task->s,
rspamd_redis_cache_fin, rt, M);
- rt->item = rspamd_symbols_cache_get_cur_item (task);
+ rt->item = rspamd_symcache_get_cur_item (task);
event_add (&rt->timeout_event, &tv);
rt->has_event = TRUE;
}
continue;
}
- if (!rspamd_symbols_cache_is_symbol_enabled (task, task->cfg->cache,
+ if (!rspamd_symcache_is_symbol_enabled (task, task->cfg->cache,
st->stcf->symbol)) {
g_ptr_array_index (task->stat_runtimes, i) = NULL;
msg_debug_task ("symbol %s is disabled, skip classification",
priority = 1;
}
- if ((ret = rspamd_symbols_cache_find_symbol (cfg->cache, name)) != -1) {
+ if ((ret = rspamd_symcache_find_symbol (cfg->cache, name)) != -1) {
if (optional) {
msg_debug_config ("duplicate symbol: %s, skip registering", name);
cd->symbol = rspamd_mempool_strdup (cfg->cfg_pool, name);
}
- ret = rspamd_symbols_cache_add_symbol (cfg->cache,
+ ret = rspamd_symcache_add_symbol (cfg->cache,
name,
priority,
lua_metric_symbol_callback,
cd->symbol = rspamd_mempool_strdup (cfg->cfg_pool, name);
}
- ret = rspamd_symbols_cache_add_symbol (cfg->cache,
+ ret = rspamd_symcache_add_symbol (cfg->cache,
name,
priority,
lua_metric_symbol_callback,
lua_settop (L, err_idx - 1);
}
else {
- ret = rspamd_symbols_cache_add_symbol (cfg->cache,
+ ret = rspamd_symcache_add_symbol (cfg->cache,
name,
priority,
NULL,
while (lua_next (L, -2)) {
lua_pushvalue (L, -2);
sym = luaL_checkstring (L, -2);
- rspamd_symbols_cache_add_symbol (cfg->cache, sym,
+ rspamd_symcache_add_symbol (cfg->cache, sym,
0, NULL, NULL,
SYMBOL_TYPE_VIRTUAL, ret);
lua_pop (L, 2);
}
else if (lua_type (L, i) == LUA_TSTRING) {
sym = luaL_checkstring (L, i);
- rspamd_symbols_cache_add_symbol (cfg->cache, sym,
+ rspamd_symcache_add_symbol (cfg->cache, sym,
0, NULL, NULL,
SYMBOL_TYPE_VIRTUAL, ret);
}
}
if (name) {
- ret = rspamd_symbols_cache_add_symbol (cfg->cache, name,
+ ret = rspamd_symcache_add_symbol (cfg->cache, name,
weight > 0 ? 0 : -1, NULL, NULL,
SYMBOL_TYPE_VIRTUAL, parent);
}
if (child_id > 0 && parent != NULL) {
if (skip_squeeze || !rspamd_lua_squeeze_dependency (L, cfg,
- rspamd_symbols_cache_symbol_by_id (cfg->cache, child_id),
+ rspamd_symcache_symbol_by_id (cfg->cache, child_id),
parent)) {
- rspamd_symbols_cache_add_dependency (cfg->cache, child_id, parent);
+ rspamd_symcache_add_dependency (cfg->cache, child_id, parent);
}
}
}
if (child != NULL && parent != NULL) {
if (skip_squeeze || !rspamd_lua_squeeze_dependency (L, cfg, child, parent)) {
- rspamd_symbols_cache_add_delayed_dependency (cfg->cache, child,
+ rspamd_symcache_add_delayed_dependency (cfg->cache, child,
parent);
}
composite);
if (new) {
- rspamd_symbols_cache_add_symbol (cfg->cache, name,
+ rspamd_symcache_add_symbol (cfg->cache, name,
0, NULL, NULL, SYMBOL_TYPE_COMPOSITE, -1);
}
/* Here we pop function from the stack, so no lua_pop is required */
condref = luaL_ref (L, LUA_REGISTRYINDEX);
g_assert (name != NULL);
- rspamd_symbols_cache_add_condition_delayed (cfg->cache,
+ rspamd_symcache_add_condition_delayed (cfg->cache,
name, L, condref);
}
else {
lua_pushvalue (L, 3);
condref = luaL_ref (L, LUA_REGISTRYINDEX);
- ret = rspamd_symbols_cache_add_condition_delayed (cfg->cache, sym, L,
+ ret = rspamd_symcache_add_condition_delayed (cfg->cache, sym, L,
condref);
if (!ret) {
if (cfg && lua_type (L, 2) == LUA_TFUNCTION) {
lua_pushvalue (L, 2);
condref = luaL_ref (L, LUA_REGISTRYINDEX);
- rspamd_symbols_cache_set_peak_callback (cfg->cache,
+ rspamd_symcache_set_peak_callback (cfg->cache,
condref);
}
const gchar *sym = luaL_checkstring (L, 2);
if (cfg && sym) {
- rspamd_symbols_cache_enable_symbol (cfg->cache, sym);
+ rspamd_symcache_enable_symbol (cfg->cache, sym);
}
else {
return luaL_error (L, "invalid arguments");
const gchar *sym = luaL_checkstring (L, 2);
if (cfg && sym) {
- rspamd_symbols_cache_disable_symbol (cfg->cache, sym);
+ rspamd_symcache_disable_symbol (cfg->cache, sym);
}
else {
return luaL_error (L, "invalid arguments");
guint res = 0;
if (cfg != NULL) {
- res = rspamd_symbols_cache_stats_symbols_count (cfg->cache);
+ res = rspamd_symcache_stats_symbols_count (cfg->cache);
}
else {
return luaL_error (L, "invalid arguments");
guint64 res = 0, *pres;
if (cfg != NULL) {
- res = rspamd_symbols_cache_get_cksum (cfg->cache);
+ res = rspamd_symcache_get_cksum (cfg->cache);
}
else {
return luaL_error (L, "invalid arguments");
ucl_object_t *counters;
if (cfg != NULL) {
- counters = rspamd_symbols_cache_counters (cfg->cache);
+ counters = rspamd_symcache_counters (cfg->cache);
ucl_object_push_lua (L, counters, true);
ucl_object_unref (counters);
}
struct lua_callback_data *cbd;
if (cfg != NULL && sym != NULL) {
- abs_cbdata = rspamd_symbols_cache_get_cbdata (cfg->cache, sym);
+ abs_cbdata = rspamd_symcache_get_cbdata (cfg->cache, sym);
if (abs_cbdata == NULL || abs_cbdata->magic != rspamd_lua_callback_magic) {
lua_pushnil (L);
struct lua_callback_data *cbd;
if (cfg != NULL && sym != NULL && lua_type (L, 3) == LUA_TFUNCTION) {
- abs_cbdata = rspamd_symbols_cache_get_cbdata (cfg->cache, sym);
+ abs_cbdata = rspamd_symcache_get_cbdata (cfg->cache, sym);
if (abs_cbdata == NULL || abs_cbdata->magic != rspamd_lua_callback_magic) {
lua_pushboolean (L, FALSE);
guint hits;
if (cfg != NULL && sym != NULL) {
- if (!rspamd_symbols_cache_stat_symbol (cfg->cache, sym, &freq,
+ if (!rspamd_symcache_stat_symbol (cfg->cache, sym, &freq,
&stddev, &tm, &hits)) {
lua_pushnil (L);
}
cbdata->s = session;
if (task) {
- cbdata->item = rspamd_symbols_cache_get_cur_item (task);
+ cbdata->item = rspamd_symcache_get_cur_item (task);
rspamd_symcache_item_async_inc (task, cbdata->item, M);
}
if (cd->item) {
/* We also need to restore the item in case there are some chains */
- rspamd_symbols_cache_set_cur_item (cd->task, cd->item);
+ rspamd_symcache_set_cur_item (cd->task, cd->item);
}
if (lua_pcall (L, 6, 0, err_idx) != 0) {
if (task) {
pool = task->task_pool;
session = task->s;
- item = rspamd_symbols_cache_get_cur_item (task);
+ item = rspamd_symcache_get_cur_item (task);
}
if (to_resolve != NULL) {
if (cbd->item) {
- rspamd_symbols_cache_set_cur_item (cbd->task, cbd->item);
+ rspamd_symcache_set_cur_item (cbd->task, cbd->item);
}
if (lua_pcall (L, 1, 0, 0) != 0) {
if (cbd->item) {
/* Replace watcher to deal with nested calls */
- rspamd_symbols_cache_set_cur_item (cbd->task, cbd->item);
+ rspamd_symcache_set_cur_item (cbd->task, cbd->item);
}
if (lua_pcall (L, 4, 0, 0) != 0) {
if (cbd->item) {
/* Replace watcher to deal with nested calls */
- rspamd_symbols_cache_set_cur_item (cbd->task, cbd->item);
+ rspamd_symcache_set_cur_item (cbd->task, cbd->item);
}
lua_thread_resume (cbd->thread, 2);
cbd->task = task;
if (task) {
- cbd->item = rspamd_symbols_cache_get_cur_item (task);
+ cbd->item = rspamd_symcache_get_cur_item (task);
}
if (msg->host) {
lua_pushnil (cbs.L);
if (ud->item) {
- rspamd_symbols_cache_set_cur_item (ud->task, ud->item);
+ rspamd_symcache_set_cur_item (ud->task, ud->item);
}
if (lua_pcall (cbs.L, 2, 0, 0) != 0) {
lua_redis_push_reply (cbs.L, r, ctx->flags & LUA_REDIS_TEXTDATA);
if (ud->item) {
- rspamd_symbols_cache_set_cur_item (ud->task, ud->item);
+ rspamd_symcache_set_cur_item (ud->task, ud->item);
}
if (lua_pcall (cbs.L, 2, 0, 0) != 0) {
ud->task = task;
if (task) {
- ud->item = rspamd_symbols_cache_get_cur_item (task);
+ ud->item = rspamd_symcache_get_cur_item (task);
}
ret = TRUE;
kh_foreach_value_ptr (mres->symbols, s, {
if (!(s->flags & RSPAMD_SYMBOL_RESULT_IGNORED)) {
- id = rspamd_symbols_cache_find_symbol (task->cfg->cache,
+ id = rspamd_symcache_find_symbol (task->cfg->cache,
s->name);
lua_pushinteger (L, id);
lua_rawseti (L, -3, i);
}
lua_createtable (L,
- rspamd_symbols_cache_stats_symbols_count (task->cfg->cache), 0);
- rspamd_symbols_cache_foreach (task->cfg->cache, tokens_foreach_cb, &cbd);
+ rspamd_symcache_stats_symbols_count (task->cfg->cache), 0);
+ rspamd_symcache_foreach (task->cfg->cache, tokens_foreach_cb, &cbd);
return 1;
}
}
}
- rspamd_symbols_cache_process_settings (task, task->cfg->cache);
+ rspamd_symcache_process_settings (task, task->cfg->cache);
}
else {
return luaL_error (L, "invalid arguments");
TCP_RETAIN (cbd);
if (cbd->item) {
- rspamd_symbols_cache_set_cur_item (cbd->task, cbd->item);
+ rspamd_symcache_set_cur_item (cbd->task, cbd->item);
}
if (lua_pcall (L, 3, 0, 0) != 0) {
TCP_RETAIN (cbd);
if (cbd->item) {
- rspamd_symbols_cache_set_cur_item (cbd->task, cbd->item);
+ rspamd_symcache_set_cur_item (cbd->task, cbd->item);
}
if (lua_pcall (L, arg_cnt, 0, 0) != 0) {
lua_thread_pool_set_running_entry (cbd->cfg->lua_thread_pool, cbd->thread);
if (cbd->item) {
- rspamd_symbols_cache_set_cur_item (cbd->task, cbd->item);
+ rspamd_symcache_set_cur_item (cbd->task, cbd->item);
}
lua_thread_resume (cbd->thread, 2);
rspamd_lua_setclass (L, "rspamd{tcp}", -1);
if (cbd->item) {
- rspamd_symbols_cache_set_cur_item (cbd->task, cbd->item);
+ rspamd_symcache_set_cur_item (cbd->task, cbd->item);
}
if (lua_pcall (L, 1, 0, 0) != 0) {
cbd->task = task;
if (task) {
- cbd->item = rspamd_symbols_cache_get_cur_item (task);
+ cbd->item = rspamd_symcache_get_cur_item (task);
}
cbd->cfg = cfg;
}
}
else {
- cbd->item = rspamd_symbols_cache_get_cur_item (task);
+ cbd->item = rspamd_symcache_get_cur_item (task);
if (!make_dns_request_task (task, lua_tcp_dns_handler, cbd,
RDNS_REQUEST_A, host)) {
cfg->lua_state = L;
cfg->rcl_obj = obj;
- cfg->cache = rspamd_symbols_cache_new (cfg);
+ cfg->cache = rspamd_symcache_new (cfg);
top = rspamd_rcl_config_init (cfg, NULL);
if (!rspamd_rcl_parse (top, cfg, cfg, cfg->cfg_pool, cfg->rcl_obj, &err)) {
chartable_module_ctx->threshold = DEFAULT_THRESHOLD;
}
- rspamd_symbols_cache_add_symbol (cfg->cache,
+ rspamd_symcache_add_symbol (cfg->cache,
chartable_module_ctx->symbol,
0,
chartable_symbol_callback,
NULL,
SYMBOL_TYPE_NORMAL,
-1);
- rspamd_symbols_cache_add_symbol (cfg->cache,
+ rspamd_symcache_add_symbol (cfg->cache,
chartable_module_ctx->url_symbol,
0,
chartable_url_symbol_callback,
utext_close (&utxt);
}
- rspamd_symbols_cache_finalize_item (task, item);
+ rspamd_symcache_finalize_item (task, item);
}
static void
}
- rspamd_symbols_cache_finalize_item (task, item);
+ rspamd_symcache_finalize_item (task, item);
}
return TRUE;
}
- cb_id = rspamd_symbols_cache_add_symbol (cfg->cache,
+ cb_id = rspamd_symcache_add_symbol (cfg->cache,
"DKIM_CHECK",
0,
dkim_symbol_callback,
NULL,
SYMBOL_TYPE_CALLBACK,
-1);
- rspamd_symbols_cache_add_symbol (cfg->cache,
+ rspamd_symcache_add_symbol (cfg->cache,
dkim_module_ctx->symbol_reject,
0,
NULL,
NULL,
- SYMBOL_TYPE_VIRTUAL|SYMBOL_TYPE_FINE,
+ SYMBOL_TYPE_VIRTUAL | SYMBOL_TYPE_FINE,
cb_id);
- rspamd_symbols_cache_add_symbol (cfg->cache,
+ rspamd_symcache_add_symbol (cfg->cache,
dkim_module_ctx->symbol_na,
0,
NULL, NULL,
- SYMBOL_TYPE_VIRTUAL|SYMBOL_TYPE_FINE,
+ SYMBOL_TYPE_VIRTUAL | SYMBOL_TYPE_FINE,
cb_id);
- rspamd_symbols_cache_add_symbol (cfg->cache,
+ rspamd_symcache_add_symbol (cfg->cache,
dkim_module_ctx->symbol_permfail,
0,
NULL, NULL,
- SYMBOL_TYPE_VIRTUAL|SYMBOL_TYPE_FINE,
+ SYMBOL_TYPE_VIRTUAL | SYMBOL_TYPE_FINE,
cb_id);
- rspamd_symbols_cache_add_symbol (cfg->cache,
+ rspamd_symcache_add_symbol (cfg->cache,
dkim_module_ctx->symbol_tempfail,
0,
NULL, NULL,
- SYMBOL_TYPE_VIRTUAL|SYMBOL_TYPE_FINE,
+ SYMBOL_TYPE_VIRTUAL | SYMBOL_TYPE_FINE,
cb_id);
- rspamd_symbols_cache_add_symbol (cfg->cache,
+ rspamd_symcache_add_symbol (cfg->cache,
dkim_module_ctx->symbol_allow,
0,
NULL, NULL,
- SYMBOL_TYPE_VIRTUAL|SYMBOL_TYPE_FINE,
+ SYMBOL_TYPE_VIRTUAL | SYMBOL_TYPE_FINE,
cb_id);
- rspamd_symbols_cache_add_symbol (cfg->cache,
+ rspamd_symcache_add_symbol (cfg->cache,
"DKIM_TRACE",
0,
NULL, NULL,
- SYMBOL_TYPE_VIRTUAL|SYMBOL_TYPE_NOSTAT,
+ SYMBOL_TYPE_VIRTUAL | SYMBOL_TYPE_NOSTAT,
cb_id);
rspamd_config_add_symbol (cfg,
"DKIM_TRACE",
cfg->cfg_pool,
dkim_module_ctx->sign_condition_ref);
- rspamd_symbols_cache_add_symbol (cfg->cache,
+ rspamd_symcache_add_symbol (cfg->cache,
"DKIM_SIGN",
0,
dkim_sign_callback,
NULL,
- SYMBOL_TYPE_CALLBACK|SYMBOL_TYPE_FINE,
+ SYMBOL_TYPE_CALLBACK | SYMBOL_TYPE_FINE,
-1);
msg_info_config ("init condition script for DKIM signing");
* Allow dkim signing to be executed only after dkim check
*/
if (cb_id > 0) {
- rspamd_symbols_cache_add_delayed_dependency (cfg->cache,
+ rspamd_symcache_add_delayed_dependency (cfg->cache,
"DKIM_SIGN", dkim_module_ctx->symbol_reject);
}
|| (!dkim_module_ctx->check_local &&
rspamd_inet_address_is_local (task->from_addr, TRUE))) {
msg_info_task ("skip DKIM checks for local networks and authorized users");
- rspamd_symbols_cache_finalize_item (task, item);
+ rspamd_symcache_finalize_item (task, item);
return;
}
if (rspamd_match_radix_map_addr (dkim_module_ctx->whitelist_ip,
task->from_addr) != NULL) {
msg_info_task ("skip DKIM checks for whitelisted address");
- rspamd_symbols_cache_finalize_item (task, item);
+ rspamd_symcache_finalize_item (task, item);
return;
}
msg_err_task ("invalid return value from sign condition: %e",
err);
g_error_free (err);
- rspamd_symbols_cache_finalize_item (task, item);
+ rspamd_symcache_finalize_item (task, item);
return;
}
lua_settop (L, 0);
luaL_error (L, "unknown key type: %s",
key_type);
- rspamd_symbols_cache_finalize_item (task, item);
+ rspamd_symcache_finalize_item (task, item);
return;
}
if (arc_idx == 0) {
lua_settop (L, 0);
luaL_error (L, "no arc idx specified");
- rspamd_symbols_cache_finalize_item (task, item);
+ rspamd_symcache_finalize_item (task, item);
return;
}
if (arc_cv == NULL) {
lua_settop (L, 0);
luaL_error (L, "no arc cv specified");
- rspamd_symbols_cache_finalize_item (task, item);
+ rspamd_symcache_finalize_item (task, item);
return;
}
if (arc_idx == 0) {
lua_settop (L, 0);
luaL_error (L, "no arc idx specified");
- rspamd_symbols_cache_finalize_item (task, item);
+ rspamd_symcache_finalize_item (task, item);
return;
}
lua_settop (L, 0);
luaL_error (L, "unknown sign type: %s",
sign_type_str);
- rspamd_symbols_cache_finalize_item (task, item);
+ rspamd_symcache_finalize_item (task, item);
return;
}
msg_err_task ("cannot load dkim key %s: %e",
lru_key, err);
g_error_free (err);
- rspamd_symbols_cache_finalize_item (task, item);
+ rspamd_symcache_finalize_item (task, item);
return;
}
msg_err_task ("cannot load dkim key %s: %e",
lru_key, err);
g_error_free (err);
- rspamd_symbols_cache_finalize_item (task, item);
+ rspamd_symcache_finalize_item (task, item);
return;
}
msg_err_task ("cannot create sign context: %e",
err);
g_error_free (err);
- rspamd_symbols_cache_finalize_item (task, item);
+ rspamd_symcache_finalize_item (task, item);
return;
}
if (!sign) {
msg_debug_task ("skip signing as dkim condition callback returned"
" false");
- rspamd_symbols_cache_finalize_item (task, item);
+ rspamd_symcache_finalize_item (task, item);
return;
}
}
- rspamd_symbols_cache_finalize_item (task, item);
+ rspamd_symcache_finalize_item (task, item);
}
struct rspamd_dkim_lua_verify_cbdata {
/* Add flag to hash table */
g_hash_table_insert (rule->mappings,
GINT_TO_POINTER (map->fuzzy_flag), map);
- rspamd_symbols_cache_add_symbol (cfg->cache,
+ rspamd_symcache_add_symbol (cfg->cache,
map->symbol, 0,
NULL, NULL,
- SYMBOL_TYPE_VIRTUAL|SYMBOL_TYPE_FINE,
+ SYMBOL_TYPE_VIRTUAL | SYMBOL_TYPE_FINE,
cb_id);
}
else {
g_ptr_array_add (fuzzy_module_ctx->fuzzy_rules, rule);
if (rule->symbol != fuzzy_module_ctx->default_symbol) {
- rspamd_symbols_cache_add_symbol (cfg->cache, rule->symbol,
+ rspamd_symcache_add_symbol (cfg->cache, rule->symbol,
0,
NULL, NULL,
- SYMBOL_TYPE_VIRTUAL|SYMBOL_TYPE_FINE,
+ SYMBOL_TYPE_VIRTUAL | SYMBOL_TYPE_FINE,
cb_id);
}
if ((value =
rspamd_config_get_module_opt (cfg, "fuzzy_check", "rule")) != NULL) {
- cb_id = rspamd_symbols_cache_add_symbol (cfg->cache,
- "FUZZY_CALLBACK", 0, fuzzy_symbol_callback, NULL,
- SYMBOL_TYPE_CALLBACK|SYMBOL_TYPE_FINE,
- -1);
+ cb_id = rspamd_symcache_add_symbol (cfg->cache,
+ "FUZZY_CALLBACK", 0, fuzzy_symbol_callback, NULL,
+ SYMBOL_TYPE_CALLBACK | SYMBOL_TYPE_FINE,
+ -1);
/*
* Here we can have 2 possibilities:
event_add (&session->timev, &session->tv);
rspamd_session_add_event (task->s, fuzzy_io_fin, session, M);
- session->item = rspamd_symbols_cache_get_cur_item (task);
+ session->item = rspamd_symcache_get_cur_item (task);
if (session->item) {
rspamd_symcache_item_async_inc (task, session->item, M);
struct fuzzy_ctx *fuzzy_module_ctx = fuzzy_get_context (task->cfg);
if (!fuzzy_module_ctx->enabled) {
- rspamd_symbols_cache_finalize_item (task, item);
+ rspamd_symcache_finalize_item (task, item);
return;
}
msg_info_task ("<%s>, address %s is whitelisted, skip fuzzy check",
task->message_id,
rspamd_inet_address_to_string (task->from_addr));
- rspamd_symbols_cache_finalize_item (task, item);
+ rspamd_symcache_finalize_item (task, item);
return;
}
res = FALSE;
}
else {
- rspamd_symbols_cache_add_symbol (cfg->cache,
+ rspamd_symcache_add_symbol (cfg->cache,
cur_item->symbol,
0,
process_regexp_item,
cur_item->symbol = ucl_object_key (value);
cur_item->lua_function = ucl_object_toclosure (value);
- rspamd_symbols_cache_add_symbol (cfg->cache,
- cur_item->symbol,
- 0,
- process_regexp_item,
- cur_item,
- SYMBOL_TYPE_NORMAL, -1);
+ rspamd_symcache_add_symbol (cfg->cache,
+ cur_item->symbol,
+ 0,
+ process_regexp_item,
+ cur_item,
+ SYMBOL_TYPE_NORMAL, -1);
nlua ++;
}
else if (value->type == UCL_OBJECT) {
}
if (cur_item && (is_lua || valid_expression)) {
- id = rspamd_symbols_cache_add_symbol (cfg->cache,
+ id = rspamd_symcache_add_symbol (cfg->cache,
cur_item->symbol,
0,
process_regexp_item,
g_assert (cur_item->symbol != NULL);
conddata = ucl_object_toclosure (elt);
- rspamd_symbols_cache_add_condition_delayed (cfg->cache,
+ rspamd_symcache_add_condition_delayed (cfg->cache,
cur_item->symbol,
conddata->L, conddata->idx);
}
rspamd_task_insert_result (task, item->symbol, res, NULL);
}
- rspamd_symbols_cache_finalize_item (task, symcache_item);
+ rspamd_symcache_finalize_item (task, symcache_item);
}
&spf_module_ctx->whitelist_ip, NULL);
}
- cb_id = rspamd_symbols_cache_add_symbol (cfg->cache,
- spf_module_ctx->symbol_fail,
- 0,
- spf_symbol_callback,
- NULL,
- SYMBOL_TYPE_NORMAL|SYMBOL_TYPE_FINE|SYMBOL_TYPE_EMPTY, -1);
- rspamd_symbols_cache_add_symbol (cfg->cache,
+ cb_id = rspamd_symcache_add_symbol (cfg->cache,
+ spf_module_ctx->symbol_fail,
+ 0,
+ spf_symbol_callback,
+ NULL,
+ SYMBOL_TYPE_NORMAL | SYMBOL_TYPE_FINE | SYMBOL_TYPE_EMPTY, -1);
+ rspamd_symcache_add_symbol (cfg->cache,
spf_module_ctx->symbol_softfail, 0,
NULL, NULL,
SYMBOL_TYPE_VIRTUAL,
cb_id);
- rspamd_symbols_cache_add_symbol (cfg->cache,
+ rspamd_symcache_add_symbol (cfg->cache,
spf_module_ctx->symbol_permfail, 0,
NULL, NULL,
SYMBOL_TYPE_VIRTUAL,
cb_id);
- rspamd_symbols_cache_add_symbol (cfg->cache,
+ rspamd_symcache_add_symbol (cfg->cache,
spf_module_ctx->symbol_na, 0,
NULL, NULL,
SYMBOL_TYPE_VIRTUAL,
cb_id);
- rspamd_symbols_cache_add_symbol (cfg->cache,
+ rspamd_symcache_add_symbol (cfg->cache,
spf_module_ctx->symbol_neutral, 0,
NULL, NULL,
SYMBOL_TYPE_VIRTUAL,
cb_id);
- rspamd_symbols_cache_add_symbol (cfg->cache,
+ rspamd_symcache_add_symbol (cfg->cache,
spf_module_ctx->symbol_allow, 0,
NULL, NULL,
SYMBOL_TYPE_VIRTUAL,
cb_id);
- rspamd_symbols_cache_add_symbol (cfg->cache,
+ rspamd_symcache_add_symbol (cfg->cache,
spf_module_ctx->symbol_dnsfail, 0,
NULL, NULL,
SYMBOL_TYPE_VIRTUAL,
if (rspamd_match_radix_map_addr (spf_module_ctx->whitelist_ip,
task->from_addr) != NULL) {
- rspamd_symbols_cache_finalize_item (task, item);
+ rspamd_symcache_finalize_item (task, item);
return;
}
|| (!spf_module_ctx->check_local &&
rspamd_inet_address_is_local (task->from_addr, TRUE))) {
msg_info_task ("skip SPF checks for local networks and authorized users");
- rspamd_symbols_cache_finalize_item (task, item);
+ rspamd_symcache_finalize_item (task, item);
return;
}
while (g_hash_table_iter_next (&it, &k, &v)) {
bit = v;
- rspamd_symbols_cache_add_symbol (cfg->cache, bit->symbol,
+ rspamd_symcache_add_symbol (cfg->cache, bit->symbol,
0, NULL, NULL,
SYMBOL_TYPE_VIRTUAL, parent_id);
msg_debug_config ("bit: %d", bit->bit);
else if (suffix->bits != NULL) {
for (i = 0; i < suffix->bits->len; i++) {
bit = &g_array_index (suffix->bits, struct surbl_bit_item, i);
- rspamd_symbols_cache_add_symbol (cfg->cache, bit->symbol,
+ rspamd_symcache_add_symbol (cfg->cache, bit->symbol,
0, NULL, NULL,
SYMBOL_TYPE_VIRTUAL, parent_id);
}
}
else {
- rspamd_symbols_cache_add_symbol (cfg->cache, suffix->symbol,
+ rspamd_symcache_add_symbol (cfg->cache, suffix->symbol,
0, NULL, NULL,
SYMBOL_TYPE_VIRTUAL, parent_id);
}
continue;
}
- cb_id = rspamd_symbols_cache_add_symbol (cfg->cache, "SURBL_CALLBACK",
+ cb_id = rspamd_symcache_add_symbol (cfg->cache, "SURBL_CALLBACK",
0, surbl_test_url, new_suffix, SYMBOL_TYPE_CALLBACK, -1);
- rspamd_symbols_cache_add_dependency (cfg->cache, cb_id,
+ rspamd_symcache_add_dependency (cfg->cache, cb_id,
SURBL_REDIRECTOR_CALLBACK);
nrules++;
new_suffix->callback_id = cb_id;
if (new_suffix->symbol) {
/* Register just a symbol itself */
- rspamd_symbols_cache_add_symbol (cfg->cache,
+ rspamd_symcache_add_symbol (cfg->cache,
new_suffix->symbol, 0,
NULL, NULL, SYMBOL_TYPE_VIRTUAL, cb_id);
nrules++;
lua_pop (L, 1); /* Remove global function */
- (void)rspamd_symbols_cache_add_symbol (cfg->cache, SURBL_REDIRECTOR_CALLBACK,
+ (void) rspamd_symcache_add_symbol (cfg->cache, SURBL_REDIRECTOR_CALLBACK,
0, surbl_test_redirector, NULL,
SYMBOL_TYPE_CALLBACK, -1);
rspamd_config_get_module_opt (cfg, "surbl",
"redirector_symbol")) != NULL) {
surbl_module_ctx->redirector_symbol = ucl_obj_tostring (value);
- rspamd_symbols_cache_add_symbol (cfg->cache,
- surbl_module_ctx->redirector_symbol,
- 0, NULL, NULL, SYMBOL_TYPE_COMPOSITE, -1);
+ rspamd_symcache_add_symbol (cfg->cache,
+ surbl_module_ctx->redirector_symbol,
+ 0, NULL, NULL, SYMBOL_TYPE_COMPOSITE, -1);
}
else {
surbl_module_ctx->redirector_symbol = NULL;
}
if (cur_suffix->options & SURBL_OPTION_CHECKDKIM) {
- rspamd_symbols_cache_add_dependency (cfg->cache,
+ rspamd_symcache_add_dependency (cfg->cache,
cur_suffix->callback_id, "DKIM_TRACE");
}
rspamd_session_add_event (task->s,
free_redirector_session, param,
M);
- param->item = rspamd_symbols_cache_get_cur_item (task);
+ param->item = rspamd_symcache_get_cur_item (task);
if (param->item) {
rspamd_symcache_item_async_inc (param->task, param->item, M);
*purl = url;
rspamd_lua_setclass (L, "rspamd{url}", -1);
lua_pushlightuserdata (L, nparam);
- rspamd_symbols_cache_set_cur_item (task, param->item);
+ rspamd_symcache_set_cur_item (task, param->item);
if (lua_pcall (L, 3, 0, 0) != 0) {
msg_err_task ("cannot call for redirector script: %s",
if (!rspamd_monitored_alive (suffix->m)) {
msg_info_surbl ("disable surbl %s as it is reported to be offline",
suffix->suffix);
- rspamd_symbols_cache_finalize_item (task, item);
+ rspamd_symcache_finalize_item (task, item);
return;
}
struct surbl_ctx *surbl_module_ctx = surbl_get_context (task->cfg);
if (!surbl_module_ctx->use_redirector || !surbl_module_ctx->redirector_tlds) {
- rspamd_symbols_cache_finalize_item (task, item);
+ rspamd_symcache_finalize_item (task, item);
return;
}
pworker++;
}
- cfg->cache = rspamd_symbols_cache_new (cfg);
+ cfg->cache = rspamd_symcache_new (cfg);
cfg->compiled_modules = modules;
cfg->compiled_workers = workers;
cfg->cfg_name = config;
(void) g_quark_from_static_string ((*pworker)->name);
pworker++;
}
- cfg->cache = rspamd_symbols_cache_new (cfg);
+ cfg->cache = rspamd_symcache_new (cfg);
cfg->compiled_modules = modules;
cfg->compiled_workers = workers;
cfg->cfg_name = config;
ret = rspamd_config_post_load (cfg, RSPAMD_CONFIG_INIT_SYMCACHE);
}
- if (!rspamd_symbols_cache_validate (rspamd_main->cfg->cache,
+ if (!rspamd_symcache_validate (rspamd_main->cfg->cache,
rspamd_main->cfg,
FALSE)) {
ret = FALSE;
struct rspamd_config *tmp_cfg, *old_cfg;
gchar *cfg_file;
- rspamd_symbols_cache_save (rspamd_main->cfg->cache);
+ rspamd_symcache_save (rspamd_main->cfg->cache);
tmp_cfg = rspamd_config_new (RSPAMD_CONFIG_INIT_DEFAULT);
tmp_cfg->libs_ctx = rspamd_main->cfg->libs_ctx;
REF_RETAIN (tmp_cfg->libs_ctx);
res = TRUE;
- if (!rspamd_symbols_cache_validate (rspamd_main->cfg->cache,
+ if (!rspamd_symcache_validate (rspamd_main->cfg->cache,
rspamd_main->cfg,
FALSE)) {
res = FALSE;
ctx->cfg = worker->srv->cfg;
ctx->ev_base = rspamd_prepare_worker (worker, "normal", accept_socket);
msec_to_tv (ctx->timeout, &ctx->io_tv);
- rspamd_symbols_cache_start_refresh (worker->srv->cfg->cache, ctx->ev_base,
+ rspamd_symcache_start_refresh (worker->srv->cfg->cache, ctx->ev_base,
worker);
ctx->resolver = dns_resolver_init (worker->srv->logger,