From 77f6b580cf68d239e9a9acaf75568f3c43109719 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Tue, 20 Jan 2015 22:44:20 +0000 Subject: [PATCH] Add initialization prototype. --- src/libstat/backends/mmaped_file.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) 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; } -- 2.39.5