summaryrefslogtreecommitdiffstats
path: root/src/cfg_utils.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2009-01-22 18:42:50 +0300
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2009-01-22 18:42:50 +0300
commitf411d46ff24dc2bcc18fd2ea29f1f16612fc676d (patch)
treefed84311c81dce0ea529d62e49c99979866f412e /src/cfg_utils.c
parent480899d784fc491a81a88a7bd95e210d9121d69b (diff)
downloadrspamd-f411d46ff24dc2bcc18fd2ea29f1f16612fc676d.tar.gz
rspamd-f411d46ff24dc2bcc18fd2ea29f1f16612fc676d.zip
* Rework statfiles result processing
* Fix small bug in protocol implementation (\r -> \r\n)
Diffstat (limited to 'src/cfg_utils.c')
-rw-r--r--src/cfg_utils.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/cfg_utils.c b/src/cfg_utils.c
index 2231a2d96..310c54fd2 100644
--- a/src/cfg_utils.c
+++ b/src/cfg_utils.c
@@ -18,12 +18,15 @@
#include "config.h"
#include "cfg_file.h"
#include "main.h"
+#include "filter.h"
#ifndef HAVE_OWN_QUEUE_H
#include <sys/queue.h>
#else
#include "queue.h"
#endif
+#define DEFAULT_SCORE 10.0
+
extern int yylineno;
extern char *yytext;
@@ -163,6 +166,8 @@ parse_bind_line (struct config_file *cf, char *str, char is_control)
void
init_defaults (struct config_file *cfg)
{
+ struct metric *def_metric;
+
cfg->memcached_error_time = DEFAULT_UPSTREAM_ERROR_TIME;
cfg->memcached_dead_time = DEFAULT_UPSTREAM_DEAD_TIME;
cfg->memcached_maxerrors = DEFAULT_UPSTREAM_MAXERRORS;
@@ -179,6 +184,13 @@ init_defaults (struct config_file *cfg)
cfg->statfiles = g_hash_table_new (g_str_hash, g_str_equal);
cfg->cfg_params = g_hash_table_new (g_str_hash, g_str_equal);
+ def_metric = memory_pool_alloc (cfg->cfg_pool, sizeof (struct metric));
+ def_metric->name = "default";
+ def_metric->func_name = "factors";
+ def_metric->func = factor_consolidation_func;
+ def_metric->required_score = DEFAULT_SCORE;
+ g_hash_table_insert (cfg->metrics, "default", def_metric);
+
LIST_INIT (&cfg->perl_modules);
}