From bca226772e9747a4587866a50122d4a8f7973b26 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Wed, 17 Jun 2009 19:31:48 +0400 Subject: * Introduce new system of workers spawning and configuring, now rspamd can be easily extended by new types of wrokers * Rework config system and avoid from using queue (3) lists * Upgrade version to 0.2.0 as config format is now incompatible with older one --- src/cfg_file.l | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'src/cfg_file.l') diff --git a/src/cfg_file.l b/src/cfg_file.l index 876ef9c4a..b758c7eb6 100644 --- a/src/cfg_file.l +++ b/src/cfg_file.l @@ -1,6 +1,7 @@ %x incl %x module %x lua +%x worker %{ @@ -32,10 +33,12 @@ extern struct config_file *cfg; .include BEGIN(incl); .module BEGIN(module); .lua BEGIN(lua); +worker BEGIN(worker); return WORKER; composites return COMPOSITES; tempdir return TEMPDIR; pidfile return PIDFILE; -workers return WORKERS; + + error_time return ERROR_TIME; dead_time return DEAD_TIME; maxerrors return MAXERRORS; @@ -43,7 +46,6 @@ reconnect_timeout return RECONNECT_TIMEOUT; connect_timeout return CONNECT_TIMEOUT; protocol return PROTOCOL; memcached return MEMCACHED; -bind_socket return BINDSOCK; servers return SERVERS; require return REQUIRE; header_filters return HEADER_FILTERS; @@ -161,6 +163,24 @@ yes|YES|no|NO|[yY]|[nN] yylval.flag=parse_flag(yytext); return FLAG; [a-zA-Z0-9_%-]+ yylval.string=strdup(yytext); return PARAM; \".+[^\\]\" yylval.string=strdup(yytext + 1); yylval.string[strlen(yylval.string) - 1] = '\0'; unescape_quotes(yylval.string); return QUOTEDSTRING; +\n /* ignore EOL */; +[ \t]+ /* ignore whitespace */; +[ \t]*#.* /* ignore comments */; +\{ return OBRACE; +\} BEGIN(INITIAL); return EBRACE; +\; return SEMICOLON; += return EQSIGN; +type return TYPE; +bind_socket return BINDSOCK; +count return COUNT; +[0-9]+ yylval.number=strtol(yytext, NULL, 10); return NUMBER; +[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3} yylval.string=strdup(yytext); return IPADDR; +[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\/[0-9]{1,2} yylval.string=strdup(yytext); return IPNETWORK; +[*a-zA-Z0-9.-]+:[0-9]{1,5} yylval.string=strdup(yytext); return HOSTPORT; +[a-zA-Z<][a-zA-Z@+>_-]* yylval.string=strdup(yytext); return STRING; +\$[a-zA-Z_][a-zA-Z0-9_]+ yylval.string=strdup(yytext + 1); return VARIABLE; +\".+[^\\]\" yylval.string=strdup(yytext + 1); yylval.string[strlen(yylval.string) - 1] = '\0'; unescape_quotes(yylval.string); return QUOTEDSTRING; + \n /* ignore EOL */; [ \t]+ /* ignore whitespace */; [ \t]*#.* /* ignore comments */; -- cgit v1.2.3