--- innwebd/controld.cpp 2004/07/04 21:54:39 1.8 +++ innwebd/controld.cpp 2008/04/11 17:14:49 1.14 @@ -1,14 +1,10 @@ /*******************************************************/ /* */ /* LeafOK Innbbsd */ -/* Copyright (C) LeafOK.com, 2003-2004 */ /* */ -/* Programmed by Leaf */ -/* E-mail:leaflet@leafok.com QQ:6049044 */ +/* Copyright (C) LeafOK.com, 2003-2008 */ /* */ -/* http://bbs.leafok.com */ -/* http://bbs.leafok.net */ -/* http://bbs.fenglin.info */ +/* http://www.leafok.com */ /* */ /*******************************************************/ @@ -89,6 +85,8 @@ int controld::Accept(void) } this->s_send(result == 0 ? "OK" : "Failed"); + + syslog << logfile::log_head << "Begin " << cmd << " ... " << (result == 0 ? "OK" : "Failed") << endl; } else { @@ -131,6 +129,8 @@ int controld::Accept(void) } this->s_send(result == 0 ? "OK" : "Failed"); + + syslog << logfile::log_head << "End " << cmd << " ... " << (result == 0 ? "OK" : "Failed") << endl; } else { @@ -139,7 +139,7 @@ int controld::Accept(void) } else { - this->_send(""501 service"); + this->s_send("501 service"); } continue; } @@ -231,7 +231,9 @@ int controld::Accept(void) } catch(CException* e) { - syslog << logfile::log_head << "Error in accept()" << endl; + char strErrMsg[1024]; + e->GetErrorMessage(strErrMsg,1024); + syslog << logfile::log_head << "Error in accept() [" << strErrMsg << "]" << endl; e->Delete(); return -1; } @@ -372,7 +374,9 @@ int controld::load_conf(const char* conf } catch(CException* e) { - syslog << logfile::log_head << "Load configuration failed" << endl; + char strErrMsg[1024]; + e->GetErrorMessage(strErrMsg,1024); + syslog << logfile::log_head << "Load configuration failed [" << strErrMsg << "]" << endl; e->Delete(); return -1; } @@ -426,36 +430,48 @@ void controld::StartupChild(void) void controld::StartupDelay(void) { + syslog << logfile::log_head << "Startup delay for " << + this->startup_delay << " seconds"<< endl; + Sleep(this->startup_delay * 1000); } void controld::ShutdownChild(void) { - if (this->bbsd.end() == 0) + if (this->bbsd.IsRunning()) { - syslog << logfile::log_head << "End BBSD ... OK" << endl; - } - else - { - syslog << logfile::log_head << "End BBSD ... Failed" << endl; + if (this->bbsd.end() == 0) + { + syslog << logfile::log_head << "End BBSD ... OK" << endl; + } + else + { + syslog << logfile::log_head << "End BBSD ... Failed" << endl; + } } - if (this->innd.end() == 0) + if (this->innd.IsRunning()) { - syslog << logfile::log_head << "End INND ... OK" << endl; - } - else - { - syslog << logfile::log_head << "End INND ... Failed" << endl; + if (this->innd.end() == 0) + { + syslog << logfile::log_head << "End INND ... OK" << endl; + } + else + { + syslog << logfile::log_head << "End INND ... Failed" << endl; + } } - if (this->outd.end() == 0) + if (this->outd.IsRunning()) { - syslog << logfile::log_head << "End OUTD ... OK" << endl; - } - else - { - syslog << logfile::log_head << "End OUTD ... Failed" << endl; + if (this->outd.end() == 0) + { + syslog << logfile::log_head << "End OUTD ... OK" << endl; + } + else + { + syslog << logfile::log_head << "End OUTD ... Failed" << endl; + } } } @@ -486,3 +502,8 @@ int controld::CleanupThreadPool(void) return 0; } + +bool controld::check_priv(void) +{ + return this->access.control; +}