|
|
|
@ -114,10 +114,16 @@ Host::~Host()
|
|
|
|
/// <returns>Zero if successful, otherwise error occurred.</returns>
|
|
|
|
/// <returns>Zero if successful, otherwise error occurred.</returns>
|
|
|
|
int Host::run()
|
|
|
|
int Host::run()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
bool ret = yaml::Parse(m_conf, m_confFile.c_str());
|
|
|
|
bool ret = false;
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
ret = yaml::Parse(m_conf, m_confFile.c_str());
|
|
|
|
if (!ret) {
|
|
|
|
if (!ret) {
|
|
|
|
::fatal("cannot read the configuration file, %s\n", m_confFile.c_str());
|
|
|
|
::fatal("cannot read the configuration file, %s\n", m_confFile.c_str());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
catch (yaml::OperationException e) {
|
|
|
|
|
|
|
|
::fatal("cannot read the configuration file, %s", e.message());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool m_daemon = m_conf["daemon"].as<bool>(false);
|
|
|
|
bool m_daemon = m_conf["daemon"].as<bool>(false);
|
|
|
|
if (m_daemon && g_foreground)
|
|
|
|
if (m_daemon && g_foreground)
|
|
|
|
|