--- innwebd/service.cpp 2004/08/10 19:55:57 1.5 +++ innwebd/service.cpp 2005/02/26 16:10:26 1.8 @@ -1,7 +1,7 @@ /*******************************************************/ /* */ /* LeafOK Innbbsd */ -/* Copyright (C) LeafOK.com, 2003-2004 */ +/* Copyright (C) LeafOK.com, 2003-2005 */ /* */ /* Programmed by Leaf */ /* E-mail:leaflet@leafok.com QQ:6049044 */ @@ -31,13 +31,15 @@ service::~service(void) void service::Run() { + int startup_err_count = 0; + this->ctrld.StartupDelay(); this->ctrld.InitThreadPool(); while (this->m_bIsRunning) { - if (this->ctrld.begin() ==0) + if (this->ctrld.begin() == 0) { syslog << logfile::log_head << "Begin CONTROLD ... OK" << endl; @@ -46,7 +48,14 @@ void service::Run() break; } syslog << logfile::log_head << "Begin CONTROLD ... Failed" << endl; - Sleep(1000 * 60); + + if (startup_err_count++ > 5) + { + this->m_bIsRunning = false; + break; + } + + Sleep(1000 * 60 * 5); } while (this->m_bIsRunning && this->ctrld.IsRunning())