X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/4744fe9d82281dd743a92bec37e27e1b4777ba66..5622b5d1aa70abbdb3cc4a03f085f560eab06dbe:/projects/stargazer/main.cpp?ds=sidebyside diff --git a/projects/stargazer/main.cpp b/projects/stargazer/main.cpp index 26eba647..aa8bdef5 100644 --- a/projects/stargazer/main.cpp +++ b/projects/stargazer/main.cpp @@ -24,7 +24,7 @@ $Author: faust $ */ -#include +//#include #include #include #include @@ -35,9 +35,10 @@ #include #include #include -#include #include +#include +#include #include #include #include @@ -93,7 +94,7 @@ class STG_STOPPER { public: STG_STOPPER() { nonstop = true; } - bool GetStatus() { return nonstop; }; + bool GetStatus() const { return nonstop; }; #ifdef NO_DAEMON void Stop(const char * __file__, int __line__) #else @@ -493,7 +494,6 @@ if (settings->ReadSettings()) string startFile(settings->GetConfDir() + START_FILE); #endif -//SetSignalHandlers(); if (ForkAndWait(settings->GetConfDir()) < 0) { STG_LOGGER & WriteServLog = GetStgLogger(); @@ -505,14 +505,13 @@ STG_LOGGER & WriteServLog = GetStgLogger(); WriteServLog.SetLogFileName(settings->GetLogFileName()); WriteServLog("Stg v. %s", SERVER_VERSION); -for (int i = 0; i < settings->GetExecutersNum(); i++) +for (size_t i = 0; i < settings->GetExecutersNum(); i++) { int ret = StartScriptExecuter(argv[0], settings->GetExecMsgKey(), &msgID, settings); if (ret < 0) { STG_LOGGER & WriteServLog = GetStgLogger(); WriteServLog("Start Script Executer error!"); - //goto exitLbl; return 1; } if (ret == 1) @@ -555,7 +554,6 @@ admins = new ADMINS(dataStore); users = new USERS(settings, dataStore, tariffs, admins->GetSysAdmin()); traffCnt = new TRAFFCOUNTER(users, tariffs, settings->GetRulesFileName()); traffCnt->SetMonitorDir(settings->GetMonitorDir()); -//tariffs->SetUsers(users); modSettings = settings->GetModulesSettings(); @@ -647,8 +645,6 @@ WriteServLog("+++++++++++++++++++++++++++++++++++++++++++++"); creat(startFile.c_str(), S_IRUSR); #endif -//*a_kill_it = 0; - while (nonstop.GetStatus()) { if (needRulesReloading) @@ -702,7 +698,7 @@ if (loop.Stop()) exitLblNotStarted: -/*modIter = modules.begin(); +modIter = modules.begin(); while (modIter != modules.end()) { std::string name = modIter->GetFileName(); @@ -715,7 +711,7 @@ while (modIter != modules.end()) printfd(__FILE__, "Failed to unload module '%s'\n", name.c_str()); } ++modIter; - }*/ + } if (traffCnt) { @@ -763,5 +759,3 @@ delete settings; return 0; } //----------------------------------------------------------------------------- - -