diff options
author | Christian Pointner <equinox@spreadspace.org> | 2010-12-10 00:41:52 +0000 |
---|---|---|
committer | Christian Pointner <equinox@spreadspace.org> | 2010-12-10 00:41:52 +0000 |
commit | fcf009ded7a77959da5592e298de93fb044a6757 (patch) | |
tree | 3cbd3d7e245e7d63e9c5eed0e5075fa97ea1a6de /src/cfg_parser.rl | |
parent | listner_ vs listeners_ (diff) |
re-reading the config file after sig-hup
git-svn-id: https://svn.spreadspace.org/tcpproxy/trunk@43 e61f0598-a718-4e21-a8f0-0aadfa62ad6b
Diffstat (limited to 'src/cfg_parser.rl')
-rw-r--r-- | src/cfg_parser.rl | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/cfg_parser.rl b/src/cfg_parser.rl index c215a83..47d237c 100644 --- a/src/cfg_parser.rl +++ b/src/cfg_parser.rl @@ -163,17 +163,18 @@ int parse_listener(char* p, char* pe, listeners_t* listener) char* eof = pe; %% write exec; - if(cs == cfg_parser_error) { + if(cs == cfg_parser_error) { log_printf(ERROR, "config file syntax error at line %d", cur_line); + listeners_revert(listener); ret = 1; - } - - // we only have one file so if we aren't there something is wrong - if(cs != cfg_parser_first_final) { + } else if(cs != cfg_parser_first_final) { + // we only have one file so if we aren't there something is wrong log_printf(ERROR, "config file syntax error: unexpected end of file"); + listeners_revert(listener); ret = 1; - } - + } else + ret = listeners_update(listener); + clear_listener_struct(&lst); return ret; |