diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2009-06-17 19:31:48 +0400 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2009-06-17 19:31:48 +0400 |
commit | bca226772e9747a4587866a50122d4a8f7973b26 (patch) | |
tree | aae459617c9b3a7a82dd0b9e2a8b03be11e3ff52 /src/cfg_file.l | |
parent | 453ecf68e3b51941944dbc3b1dece11342be3810 (diff) | |
download | rspamd-bca226772e9747a4587866a50122d4a8f7973b26.tar.gz rspamd-bca226772e9747a4587866a50122d4a8f7973b26.zip |
* 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
Diffstat (limited to 'src/cfg_file.l')
-rw-r--r-- | src/cfg_file.l | 24 |
1 files changed, 22 insertions, 2 deletions
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; <module>[a-zA-Z0-9_%-]+ yylval.string=strdup(yytext); return PARAM; <module>\".+[^\\]\" yylval.string=strdup(yytext + 1); yylval.string[strlen(yylval.string) - 1] = '\0'; unescape_quotes(yylval.string); return QUOTEDSTRING; +<worker>\n /* ignore EOL */; +<worker>[ \t]+ /* ignore whitespace */; +<worker>[ \t]*#.* /* ignore comments */; +<worker>\{ return OBRACE; +<worker>\} BEGIN(INITIAL); return EBRACE; +<worker>\; return SEMICOLON; +<worker>= return EQSIGN; +<worker>type return TYPE; +<worker>bind_socket return BINDSOCK; +<worker>count return COUNT; +<worker>[0-9]+ yylval.number=strtol(yytext, NULL, 10); return NUMBER; +<worker>[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3} yylval.string=strdup(yytext); return IPADDR; +<worker>[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; +<worker>[*a-zA-Z0-9.-]+:[0-9]{1,5} yylval.string=strdup(yytext); return HOSTPORT; +<worker>[a-zA-Z<][a-zA-Z@+>_-]* yylval.string=strdup(yytext); return STRING; +<worker>\$[a-zA-Z_][a-zA-Z0-9_]+ yylval.string=strdup(yytext + 1); return VARIABLE; +<worker>\".+[^\\]\" yylval.string=strdup(yytext + 1); yylval.string[strlen(yylval.string) - 1] = '\0'; unescape_quotes(yylval.string); return QUOTEDSTRING; + <lua>\n /* ignore EOL */; <lua>[ \t]+ /* ignore whitespace */; <lua>[ \t]*#.* /* ignore comments */; |