]> source.dussan.org Git - rspamd.git/commitdiff
Fix configuration issues
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 5 Jan 2016 17:30:58 +0000 (17:30 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 5 Jan 2016 17:30:58 +0000 (17:30 +0000)
src/libstat/backends/backends.h
src/libstat/stat_config.c
src/libstat/stat_internal.h

index 800030414bc3f0626a1e67a66df6687b0f2e2421..da04ebbb841aaa077f98d512e25ced7be18f809c 100644 (file)
@@ -36,8 +36,7 @@ struct rspamd_statfile_config;
 struct rspamd_config;
 struct rspamd_stat_ctx;
 struct rspamd_token_result;
-struct rspamd_statfile_runtime;
-struct token_node_s;
+struct rspamd_statfile;
 struct rspamd_task;
 
 struct rspamd_stat_backend {
index baf757ac7c9793437203fbd7ed4ab48fceb6ee85..6470793674eb1e96f3a81a56b4ce17c340bd5c0d 100644 (file)
@@ -57,9 +57,9 @@ static struct rspamd_stat_tokenizer stat_tokenizers[] = {
                .name = #nam, \
                .init = rspamd_##eltn##_init, \
                .runtime = rspamd_##eltn##_runtime, \
-               .process_token = rspamd_##eltn##_process_token, \
+               .process_tokens = rspamd_##eltn##_process_tokens, \
                .finalize_process = rspamd_##eltn##_finalize_process, \
-               .learn_token = rspamd_##eltn##_learn_token, \
+               .learn_tokens = rspamd_##eltn##_learn_tokens, \
                .finalize_learn = rspamd_##eltn##_finalize_learn, \
                .total_learns = rspamd_##eltn##_total_learns, \
                .inc_learns = rspamd_##eltn##_inc_learns, \
@@ -86,7 +86,6 @@ static struct rspamd_stat_cache stat_caches[] = {
 void
 rspamd_stat_init (struct rspamd_config *cfg)
 {
-       guint i;
        GList *cur, *curst;
        struct rspamd_classifier_config *clf;
        struct rspamd_statfile_config *stf;
@@ -126,7 +125,7 @@ rspamd_stat_init (struct rspamd_config *cfg)
                 * We NO LONGER support multiple tokenizers per rspamd instance
                 */
                if (stat_ctx->tkcf == NULL) {
-                       stat_ctx->tokenizer = rspamd_stat_get_tokenizer (clf->tokenizer);
+                       stat_ctx->tokenizer = rspamd_stat_get_tokenizer (clf->tokenizer->name);
                        g_assert (stat_ctx->tokenizer != NULL);
                        stat_ctx->tkcf = stat_ctx->tokenizer->get_config (cfg->cfg_pool,
                                        clf->tokenizer, NULL);
@@ -160,9 +159,10 @@ rspamd_stat_init (struct rspamd_config *cfg)
                        st = g_slice_alloc0 (sizeof (*st));
                        st->classifier = cl;
                        st->stcf = stf;
-                       st->bkcf = stat_ctx->backends_subrs[i].init (stat_ctx, cfg, st);
-                       msg_debug_config ("added backend %s",
-                                       stat_ctx->backends_subrs[i].name);
+                       st->backend = bk;
+                       st->bkcf = bk->init (stat_ctx, cfg, st);
+                       msg_debug_config ("added backend %s for symbol %s",
+                                       bk->name, stf->symbol);
 
                        if (st->bkcf == NULL) {
                                msg_err_config ("cannot init backend %s for statfile %s",
index 2dd3f2fb52a36c158ad784a4962ec135b417288b..09fd87fb64baad769837181f6c6238836095f1c4 100644 (file)
@@ -81,7 +81,7 @@ typedef struct token_node_s {
        guchar data[RSPAMD_MAX_TOKEN_LEN];
        guint window_idx;
        guint datalen;
-       gdouble values[0];
+       gdouble values[];
 } rspamd_token_t;
 
 struct rspamd_stat_ctx {