]> git.netwichtig.de Git - user/henk/code/inspircd.git/commit - include/configparser.h
Add support for mandatory tags in included config files
authorattilamolnar <attilamolnar@hush.com>
Tue, 12 Mar 2013 17:21:21 +0000 (18:21 +0100)
committerattilamolnar <attilamolnar@hush.com>
Wed, 20 Mar 2013 20:43:46 +0000 (21:43 +0100)
commitfd6a8e93920553e2e6655b0f396be61a6e6b832c
tree220abd6238d42c3273833e1aae5bdaa4b5fdf153
parentf658270c83cbd99196c3a233ccab60fa8de6e806
Add support for mandatory tags in included config files

If the mandatory tag is not found in the included config, the rehash is aborted. This is especially useful for remote includes, as it allows users to have a dummy tag at the end of the included config to indicate that the config has been wholly read.
This method does not depend on exit codes so even situations where wget returns an empty or a wrong page that we would otherwise accept can be detected and an error can be generated before we assume that the contents have disappeared (and unload all modules, if the included file is supposed to contain module tags, for example).

Usage: <include ... mandatorytag="namehere"> - if the included config doesn't contain a <namehere> tag then the rehash is aborted

Fixes #30 reported by @Justasic
include/configparser.h
src/configparser.cpp