aboutsummaryrefslogtreecommitdiffstats
path: root/src/cfg_file.y
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2008-12-02 19:58:28 +0300
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2008-12-02 19:58:28 +0300
commitd62fb36650acfd0863c32a78b0941a4c0d0e58b1 (patch)
tree1ea3b31a0f274a040a512523c24b493b63126165 /src/cfg_file.y
parent9a1ba2296dd152c8eb7d19a70de51721be836baa (diff)
downloadrspamd-d62fb36650acfd0863c32a78b0941a4c0d0e58b1.tar.gz
rspamd-d62fb36650acfd0863c32a78b0941a4c0d0e58b1.zip
* Add learning interface to rspamd (still requires classifier to work)
Diffstat (limited to 'src/cfg_file.y')
-rw-r--r--src/cfg_file.y30
1 files changed, 28 insertions, 2 deletions
diff --git a/src/cfg_file.y b/src/cfg_file.y
index 62f247485..dc57df2a4 100644
--- a/src/cfg_file.y
+++ b/src/cfg_file.y
@@ -53,7 +53,7 @@ struct statfile *cur_statfile = NULL;
%token REQUIRED_SCORE FUNCTION FRACT COMPOSITES CONTROL PASSWORD
%token LOGGING LOG_TYPE LOG_TYPE_CONSOLE LOG_TYPE_SYSLOG LOG_TYPE_FILE
%token LOG_LEVEL LOG_LEVEL_DEBUG LOG_LEVEL_INFO LOG_LEVEL_WARNING LOG_LEVEL_ERROR LOG_FACILITY LOG_FILENAME
-%token STATFILE ALIAS PATTERN WEIGHT
+%token STATFILE ALIAS PATTERN WEIGHT STATFILE_POOL_SIZE SIZE
%type <string> STRING
%type <string> VARIABLE
@@ -94,6 +94,7 @@ command :
| composites
| logging
| statfile
+ | statfile_pool_size
;
tempdir :
@@ -544,7 +545,8 @@ loggingfile:
statfile:
STATFILE OBRACE statfilebody EBRACE {
- if (cur_statfile == NULL || cur_statfile->alias == NULL || cur_statfile->pattern == NULL || cur_statfile->weight == 0) {
+ if (cur_statfile == NULL || cur_statfile->alias == NULL || cur_statfile->pattern == NULL
+ || cur_statfile->weight == 0 || cur_statfile->size == 0) {
yyerror ("yyparse: not enough arguments in statfile definition");
YYERROR;
}
@@ -562,6 +564,7 @@ statfilecmd:
| statfilealias
| statfilepattern
| statfileweight
+ | statfilesize
;
statfilealias:
@@ -597,7 +600,30 @@ statfileweight:
}
;
+statfilesize:
+ SIZE EQSIGN NUMBER {
+ if (cur_statfile == NULL) {
+ cur_statfile = memory_pool_alloc0 (cfg->cfg_pool, sizeof (struct statfile));
+ }
+ cur_statfile->size = $3;
+ }
+ | WEIGHT EQSIGN SIZELIMIT {
+ if (cur_statfile == NULL) {
+ cur_statfile = memory_pool_alloc0 (cfg->cfg_pool, sizeof (struct statfile));
+ }
+ cur_statfile->size = $3;
+ }
+ ;
+
+statfile_pool_size:
+ STATFILE_POOL_SIZE EQSIGN SIZELIMIT {
+ cfg->max_statfile_size = $3;
+ }
+ | STATFILE_POOL_SIZE EQSIGN NUMBER {
+ cfg->max_statfile_size = $3;
+ }
+ ;
%%
/*
* vi:ts=4