]> source.dussan.org Git - rspamd.git/commitdiff
Save classifier configuration inside statfile config.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 1 Apr 2015 11:12:53 +0000 (12:12 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 1 Apr 2015 11:12:53 +0000 (12:12 +0100)
src/libserver/cfg_file.h
src/libserver/cfg_rcl.c
src/libstat/tokenizers/tokenizers.c
src/libstat/tokenizers/tokenizers.h

index 06232cff89cc321f679cd411f2d31c5035eb95fc..16ecb2800e207bfcb28395e905f0d3523831a653 100644 (file)
@@ -113,6 +113,7 @@ struct rspamd_statfile_config {
        ucl_object_t *opts;                             /**< other options                                                                              */
        gboolean is_spam;                               /**< spam flag                                                                                  */
        const gchar *backend;                                                   /**< name of statfile's backend                                                 */
+       struct rspamd_classifier_config *clcf;                  /**< parent pointer of classifier configuration                 */
        gpointer data;                                                                  /**< opaque data                                                                                */
 };
 
index 1d77e31687751a46a64caada7da724896321085c..6eaaeda630fc772129e4380f7648b6f2f580cccb 100644 (file)
@@ -906,6 +906,7 @@ rspamd_rcl_statfile_handler (rspamd_mempool_t *pool, const ucl_object_t *obj,
                }
 
                st->opts = (ucl_object_t *)obj;
+               st->clcf = ccf;
 
                val = ucl_object_find_key (obj, "spam");
                if (val == NULL) {
index 2abe0f318a2dcab164de6d8af5d52def7e6bc1a0..63452dfb1b1aebb79f7e81e14ad4cb3e5116f6f8 100644 (file)
@@ -72,7 +72,7 @@ token_node_compare_func (gconstpointer a, gconstpointer b)
 }
 
 /* Get next word from specified f_str_t buf */
-gchar *
+static gchar *
 rspamd_tokenizer_get_word (rspamd_fstring_t * buf, rspamd_fstring_t * token, GList **exceptions)
 {
        gsize remain, pos;
index bab18b00aeeadc5c6a5d95b90684ef14450db9b0..a93f5329d0e1d1ff45ddc8d23514bd5374207c56 100644 (file)
@@ -22,9 +22,6 @@ struct rspamd_stat_tokenizer {
 /* Compare two token nodes */
 int token_node_compare_func (gconstpointer a, gconstpointer b);
 
-/* Get next word from specified f_str_t buf */
-gchar * rspamd_tokenizer_get_word (rspamd_fstring_t *buf,
-               rspamd_fstring_t *token, GList **exceptions);
 
 /* Tokenize text into array of words (rspamd_fstring_t type) */
 GArray * rspamd_tokenize_text (gchar *text, gsize len, gboolean is_utf,