#endif
std::ifstream ifs(config);
- if (!ifs)
- warnlog("Unable to read configuration from '%s'", config);
- else
+ if (!ifs) {
+ if (configCheck) {
+ throw std::runtime_error("Unable to read configuration file from " + config);
+ }
+ else {
+ warnlog("Unable to read configuration from '%s'", config);
+ }
+ }
+ else {
vinfolog("Read configuration from '%s'", config);
+ }
luaCtx.executeCode(ifs);
ServerPolicy leastOutstandingPol{"leastOutstanding", leastOutstanding, false};
g_policy.setState(leastOutstandingPol);
- if(g_cmdLine.beClient || !g_cmdLine.command.empty()) {
+ if (g_cmdLine.beClient || !g_cmdLine.command.empty()) {
setupLua(*(g_lua.lock()), true, false, g_cmdLine.config);
if (clientAddress != ComboAddress())
g_serverControl = clientAddress;
LocalStateHolder<pools_t> pools;
};
-vector<std::function<void(void)>> setupLua(bool client, const std::string& config);
-
void tcpAcceptorThread(std::vector<ClientState*> states);
#ifdef HAVE_DNS_OVER_HTTPS