From 78e14695fc1b743f225a5aa30ca98784bce576c1 Mon Sep 17 00:00:00 2001 From: Maxim Mamontov Date: Wed, 26 Jan 2011 17:52:49 +0200 Subject: [PATCH 1/1] =?utf8?q?=D0=94=D0=BE=D0=B4=D0=B0=D0=BD=D0=BE=20?= =?utf8?q?=D0=BF=D1=80=D0=BE=D0=BF=D1=83=D1=89=D0=B5=D0=BD=D1=96=20=D0=B7?= =?utf8?q?=D0=B0=D0=B3=D0=BE=D0=BB=D0=BE=D0=B2=D0=BE=D1=87=D0=BD=D1=96=20?= =?utf8?q?=D1=84=D0=B0=D0=B9=D0=BB=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- projects/stargazer/main.cpp | 16 ++++++---------- .../authorization/inetaccess/inetaccess.cpp | 3 +++ .../configuration/rpcconfig/users_methods.cpp | 2 ++ .../configuration/sgconfig/parser_tariff.cpp | 2 +- .../plugins/configuration/sgconfig/rsconf.cpp | 3 ++- .../stargazer/plugins/other/radius/radius.cpp | 1 + projects/stargazer/traffcounter.cpp | 1 + 7 files changed, 16 insertions(+), 12 deletions(-) diff --git a/projects/stargazer/main.cpp b/projects/stargazer/main.cpp index 7a225ce5..2d5b808f 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 @@ -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) { diff --git a/projects/stargazer/plugins/authorization/inetaccess/inetaccess.cpp b/projects/stargazer/plugins/authorization/inetaccess/inetaccess.cpp index 6d8db063..47ff002d 100644 --- a/projects/stargazer/plugins/authorization/inetaccess/inetaccess.cpp +++ b/projects/stargazer/plugins/authorization/inetaccess/inetaccess.cpp @@ -30,8 +30,11 @@ #include #include + #include #include +#include // snprintf +#include #include #include "inetaccess.h" diff --git a/projects/stargazer/plugins/configuration/rpcconfig/users_methods.cpp b/projects/stargazer/plugins/configuration/rpcconfig/users_methods.cpp index 72fb399e..fd9f86be 100644 --- a/projects/stargazer/plugins/configuration/rpcconfig/users_methods.cpp +++ b/projects/stargazer/plugins/configuration/rpcconfig/users_methods.cpp @@ -1,3 +1,5 @@ +#include + #include "users_methods.h" #include "../../../users.h" diff --git a/projects/stargazer/plugins/configuration/sgconfig/parser_tariff.cpp b/projects/stargazer/plugins/configuration/sgconfig/parser_tariff.cpp index aeb1c783..e3b26520 100644 --- a/projects/stargazer/plugins/configuration/sgconfig/parser_tariff.cpp +++ b/projects/stargazer/plugins/configuration/sgconfig/parser_tariff.cpp @@ -1,4 +1,4 @@ -//#include +#include // snprintf #include #include "parser.h" diff --git a/projects/stargazer/plugins/configuration/sgconfig/rsconf.cpp b/projects/stargazer/plugins/configuration/sgconfig/rsconf.cpp index 8d2ce153..a3957f36 100644 --- a/projects/stargazer/plugins/configuration/sgconfig/rsconf.cpp +++ b/projects/stargazer/plugins/configuration/sgconfig/rsconf.cpp @@ -28,6 +28,7 @@ #include #include +#include // snprintf #include "configproto.h" #include "blowfish.h" @@ -545,7 +546,7 @@ void CONFIGPROTO::SendError(const char * text) { char s[255]; answerList.clear(); -sprintf(s, "", text); +snprintf(s, 255, "", text); answerList.push_back(s); } //----------------------------------------------------------------------------- diff --git a/projects/stargazer/plugins/other/radius/radius.cpp b/projects/stargazer/plugins/other/radius/radius.cpp index 9b8c67d1..9c5ab1db 100644 --- a/projects/stargazer/plugins/other/radius/radius.cpp +++ b/projects/stargazer/plugins/other/radius/radius.cpp @@ -27,6 +27,7 @@ */ #include +#include #include #include "radius.h" diff --git a/projects/stargazer/traffcounter.cpp b/projects/stargazer/traffcounter.cpp index e9c143ec..1d088f48 100644 --- a/projects/stargazer/traffcounter.cpp +++ b/projects/stargazer/traffcounter.cpp @@ -30,6 +30,7 @@ #include #include +#include // Functions fopen and similar #include "traffcounter.h" #include "common.h" -- 2.44.2