aboutsummaryrefslogtreecommitdiffstats
path: root/src/cfg_file.l
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2010-03-25 19:19:47 +0300
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2010-03-25 19:19:47 +0300
commit2f2642851746b0985f67e8dde58e2458eae07cca (patch)
treec379cf43cf7a26be6e70111e8e79815258a1c0ee /src/cfg_file.l
parent9e16e433e1386b3613ea5667b12ee14c3ef0588c (diff)
downloadrspamd-2f2642851746b0985f67e8dde58e2458eae07cca.tar.gz
rspamd-2f2642851746b0985f67e8dde58e2458eae07cca.zip
* Initial add of xml parser for rspamd configuration
Diffstat (limited to 'src/cfg_file.l')
-rw-r--r--src/cfg_file.l8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/cfg_file.l b/src/cfg_file.l
index 48cf18c44..fd83be66c 100644
--- a/src/cfg_file.l
+++ b/src/cfg_file.l
@@ -130,6 +130,14 @@ yes|YES|no|NO|[yY]|[nN] yylval.flag=parse_flag(yytext); return FLAG;
<incl>[ \t]* /* eat the whitespace */
<incl>[^ \t\n]+ { /* got the include file name */
/* got the include file name */
+ /* Handle XML case */
+ int len = strlen (yytext);
+ if (strcmp (yytext + len - 4, ".xml") == 0) {
+ if (!read_xml_config (cfg, yytext)) {
+ yyerror ("invalid xml detected");
+ }
+ BEGIN(INITIAL);
+ }
if ( include_stack_ptr >= MAX_INCLUDE_DEPTH ) {
yyerror ("yylex: includes nested too deeply" );
return -1;