diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-01-05 19:04:24 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-01-05 19:04:24 +0000 |
commit | 29b7115762ad84865b6b657c8f5e88aba16e8eb4 (patch) | |
tree | 3510b622bcc91644234a9e9a25825d3f7c1b1de6 /src/libstat/stat_config.c | |
parent | e5676fe57ac78238817b64efa107e00d34485a9c (diff) | |
download | rspamd-29b7115762ad84865b6b657c8f5e88aba16e8eb4.tar.gz rspamd-29b7115762ad84865b6b657c8f5e88aba16e8eb4.zip |
Fix init/deinit of statistics
Diffstat (limited to 'src/libstat/stat_config.c')
-rw-r--r-- | src/libstat/stat_config.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/libstat/stat_config.c b/src/libstat/stat_config.c index 32d09f4a9..1f16a98de 100644 --- a/src/libstat/stat_config.c +++ b/src/libstat/stat_config.c @@ -135,7 +135,7 @@ rspamd_stat_init (struct rspamd_config *cfg) cl->cfg = clf; cl->ctx = stat_ctx; cl->statfiles_ids = g_array_new (FALSE, FALSE, sizeof (gint)); - cl->subrs = rspamd_stat_get_classifier (clf->name); + cl->subrs = rspamd_stat_get_classifier (clf->classifier); g_assert (cl->subrs != NULL); cl->subrs->init_func (cfg->cfg_pool, cl); @@ -197,12 +197,7 @@ rspamd_stat_close (void) g_assert (stat_ctx != NULL); - for (i = 0; i < stat_ctx->backends_count; i ++) { - if (stat_ctx->backends_subrs[i].close != NULL) { - stat_ctx->backends_subrs[i].close (stat_ctx->backends_subrs[i].ctx); - msg_debug_config ("closed backend %s", stat_ctx->backends_subrs[i].name); - } - } + /* TODO: add cleanup routine */ REF_RELEASE (stat_ctx->cfg); } @@ -218,6 +213,10 @@ rspamd_stat_get_classifier (const gchar *name) { guint i; + if (name == NULL || name[0] == '\0') { + name = RSPAMD_DEFAULT_CLASSIFIER; + } + for (i = 0; i < stat_ctx->classifiers_count; i ++) { if (strcmp (name, stat_ctx->classifiers_subrs[i].name) == 0) { return &stat_ctx->classifiers_subrs[i]; |