summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-04-01 12:12:53 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-04-01 12:12:53 +0100
commitf636cc6c4eeab94865673d047f9b13672deede83 (patch)
tree5531146025d45feae9c5184f60243726f467fe0f /src
parent26339c8c2c0f9ab12c18d50219679fcf95a5e57d (diff)
downloadrspamd-f636cc6c4eeab94865673d047f9b13672deede83.tar.gz
rspamd-f636cc6c4eeab94865673d047f9b13672deede83.zip
Save classifier configuration inside statfile config.
Diffstat (limited to 'src')
-rw-r--r--src/libserver/cfg_file.h1
-rw-r--r--src/libserver/cfg_rcl.c1
-rw-r--r--src/libstat/tokenizers/tokenizers.c2
-rw-r--r--src/libstat/tokenizers/tokenizers.h3
4 files changed, 3 insertions, 4 deletions
diff --git a/src/libserver/cfg_file.h b/src/libserver/cfg_file.h
index 06232cff8..16ecb2800 100644
--- a/src/libserver/cfg_file.h
+++ b/src/libserver/cfg_file.h
@@ -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 */
};
diff --git a/src/libserver/cfg_rcl.c b/src/libserver/cfg_rcl.c
index 1d77e3168..6eaaeda63 100644
--- a/src/libserver/cfg_rcl.c
+++ b/src/libserver/cfg_rcl.c
@@ -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) {
diff --git a/src/libstat/tokenizers/tokenizers.c b/src/libstat/tokenizers/tokenizers.c
index 2abe0f318..63452dfb1 100644
--- a/src/libstat/tokenizers/tokenizers.c
+++ b/src/libstat/tokenizers/tokenizers.c
@@ -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;
diff --git a/src/libstat/tokenizers/tokenizers.h b/src/libstat/tokenizers/tokenizers.h
index bab18b00a..a93f5329d 100644
--- a/src/libstat/tokenizers/tokenizers.h
+++ b/src/libstat/tokenizers/tokenizers.h
@@ -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,