]> source.dussan.org Git - rspamd.git/commitdiff
Add initialization prototype.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 20 Jan 2015 22:44:20 +0000 (22:44 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 20 Jan 2015 22:44:20 +0000 (22:44 +0000)
src/libstat/backends/mmaped_file.c

index 43baaa67ca3a787dd4703062e553680797362c68..3cf7e8751a7f334ca10d24736e2b791a0900146b 100644 (file)
@@ -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;
 }