aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-01-20 22:44:20 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-01-20 22:44:20 +0000
commit77f6b580cf68d239e9a9acaf75568f3c43109719 (patch)
tree7f4b6c13593614d62020885d9776a11918b9e2fb
parentfac115a3a452dc1aebdb4a64d425af4e7318a671 (diff)
downloadrspamd-77f6b580cf68d239e9a9acaf75568f3c43109719.tar.gz
rspamd-77f6b580cf68d239e9a9acaf75568f3c43109719.zip
Add initialization prototype.
-rw-r--r--src/libstat/backends/mmaped_file.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/libstat/backends/mmaped_file.c b/src/libstat/backends/mmaped_file.c
index 43baaa67c..3cf7e8751 100644
--- a/src/libstat/backends/mmaped_file.c
+++ b/src/libstat/backends/mmaped_file.c
@@ -190,12 +190,33 @@ gpointer
rspamd_mmaped_file_init (struct rspamd_config *cfg)
{
rspamd_mmaped_file_ctx *new;
+ struct rspamd_classifier_config *clf;
+ struct rspamd_statfile_config *stf;
+ GList *cur, *curst;
+ rspamd_mmaped_file_t *mf;
+ const ucl_object_t *sizeo, *patho;
new = rspamd_mempool_alloc0 (cfg->cfg_pool, sizeof (rspamd_mmaped_file_ctx));
new->lock = rspamd_mempool_get_mutex (new->pool);
new->mlock_ok = cfg->mlock_statfile_pool;
new->files = g_hash_table_new (g_str_hash, g_str_equal);
+ /* Iterate over all classifiers and load matching statfiles */
+ cur = cfg->classifiers;
+
+ while (cur) {
+ clf = cur->data;
+
+ curst = clf->statfiles;
+ while (curst) {
+ stf = cur->data;
+
+ curst = curst->next;
+ }
+
+ cur = g_list_next (cur);
+ }
+
return (gpointer)new;
}