struct rspamd_statfile *st);
gpointer (*runtime) (struct rspamd_task *task,
- struct rspamd_statfile_config *stcf, gboolean learn, gpointer ctx);
+ struct rspamd_statfile_config *stcf,
+ gboolean learn, gpointer ctx,
+ gint id);
gboolean (*process_tokens) (struct rspamd_task *task, GPtrArray *tokens,
gint id,
struct rspamd_config *cfg, struct rspamd_statfile *st); \
gpointer rspamd_##name##_runtime (struct rspamd_task *task, \
struct rspamd_statfile_config *stcf, \
- gboolean learn, gpointer ctx); \
+ gboolean learn, gpointer ctx, gint id); \
gboolean rspamd_##name##_process_tokens (struct rspamd_task *task, \
GPtrArray *tokens, gint id, \
gpointer runtime); \
rspamd_cdb_runtime(struct rspamd_task* task,
struct rspamd_statfile_config* stcf,
gboolean learn,
- gpointer ctx)
+ gpointer ctx,
+ gint _id)
{
/* In CDB we don't have any dynamic stuff */
return ctx;
}
gpointer
rspamd_http_runtime(struct rspamd_task* task,
- struct rspamd_statfile_config* stcf,
- gboolean learn,
- gpointer ctx)
+ struct rspamd_statfile_config* stcf,
+ gboolean learn,
+ gpointer ctx,
+ gint _id)
{
auto maybe_existing = rspamd_mempool_get_variable(task->task_pool, RSPAMD_MEMPOOL_HTTP_STAT_BACKEND_RUNTIME);
gpointer
rspamd_mmaped_file_runtime (struct rspamd_task *task,
- struct rspamd_statfile_config *stcf,
- gboolean learn,
- gpointer p)
+ struct rspamd_statfile_config *stcf,
+ gboolean learn,
+ gpointer p,
+ gint _id)
{
rspamd_mmaped_file_t *mf = p;
gpointer
rspamd_redis_runtime (struct rspamd_task *task,
struct rspamd_statfile_config *stcf,
- gboolean learn, gpointer c)
+ gboolean learn, gpointer c, gint _id)
{
struct redis_stat_ctx *ctx = REDIS_CTX (c);
struct redis_stat_runtime *rt;
gpointer
rspamd_sqlite3_runtime (struct rspamd_task *task,
- struct rspamd_statfile_config *stcf, gboolean learn, gpointer p)
+ struct rspamd_statfile_config *stcf, gboolean learn, gpointer p, gint _id)
{
struct rspamd_stat_sqlite3_rt *rt = NULL;
struct rspamd_stat_sqlite3_db *bk = p;
continue;
}
- bk_run = st->backend->runtime (task, st->stcf, is_learn, st->bkcf);
+ bk_run = st->backend->runtime (task, st->stcf, is_learn, st->bkcf, i);
if (bk_run == NULL) {
msg_err_task ("cannot init backend %s for statfile %s",
id = g_array_index (cl->statfiles_ids, gint, j);
st = g_ptr_array_index (st_ctx->statfiles, id);
backend_runtime = st->backend->runtime (task, st->stcf, FALSE,
- st->bkcf);
+ st->bkcf, id);
elt = st->backend->get_stat (backend_runtime, st->bkcf);
if (elt && ucl_object_type (elt) == UCL_OBJECT) {