git.stg.codes
/
stg.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Ticket 37. The 'change_policy_timeout' field added to update tb_tariffs
[stg.git]
/
projects
/
stargazer
/
plugins
/
authorization
/
inetaccess
/
inetaccess.cpp
diff --git
a/projects/stargazer/plugins/authorization/inetaccess/inetaccess.cpp
b/projects/stargazer/plugins/authorization/inetaccess/inetaccess.cpp
index 1d126ae55a0ff8e2425b6cb0ad143882815f0f0f..99e0a091819ff873a52708b096c9534c343ef9a9 100644
(file)
--- a/
projects/stargazer/plugins/authorization/inetaccess/inetaccess.cpp
+++ b/
projects/stargazer/plugins/authorization/inetaccess/inetaccess.cpp
@@
-86,7
+86,7
@@
std::vector<PARAM_VALUE>::const_iterator pvi;
///////////////////////////
pv.param = "Port";
pvi = find(s.moduleParams.begin(), s.moduleParams.end(), pv);
///////////////////////////
pv.param = "Port";
pvi = find(s.moduleParams.begin(), s.moduleParams.end(), pv);
-if (pvi == s.moduleParams.end())
+if (pvi == s.moduleParams.end()
|| pvi->value.empty()
)
{
errorStr = "Parameter \'Port\' not found.";
printfd(__FILE__, "Parameter 'Port' not found\n");
{
errorStr = "Parameter \'Port\' not found.";
printfd(__FILE__, "Parameter 'Port' not found\n");
@@
-102,7
+102,7
@@
port = static_cast<uint16_t>(p);
///////////////////////////
pv.param = "UserDelay";
pvi = find(s.moduleParams.begin(), s.moduleParams.end(), pv);
///////////////////////////
pv.param = "UserDelay";
pvi = find(s.moduleParams.begin(), s.moduleParams.end(), pv);
-if (pvi == s.moduleParams.end())
+if (pvi == s.moduleParams.end()
|| pvi->value.empty()
)
{
errorStr = "Parameter \'UserDelay\' not found.";
printfd(__FILE__, "Parameter 'UserDelay' not found\n");
{
errorStr = "Parameter \'UserDelay\' not found.";
printfd(__FILE__, "Parameter 'UserDelay' not found\n");
@@
-118,7
+118,7
@@
if (ParseIntInRange(pvi->value[0], 5, 600, &userDelay))
///////////////////////////
pv.param = "UserTimeout";
pvi = find(s.moduleParams.begin(), s.moduleParams.end(), pv);
///////////////////////////
pv.param = "UserTimeout";
pvi = find(s.moduleParams.begin(), s.moduleParams.end(), pv);
-if (pvi == s.moduleParams.end())
+if (pvi == s.moduleParams.end()
|| pvi->value.empty()
)
{
errorStr = "Parameter \'UserTimeout\' not found.";
printfd(__FILE__, "Parameter 'UserTimeout' not found\n");
{
errorStr = "Parameter \'UserTimeout\' not found.";
printfd(__FILE__, "Parameter 'UserTimeout' not found\n");
@@
-134,7
+134,7
@@
if (ParseIntInRange(pvi->value[0], 15, 1200, &userTimeout))
///////////////////////////
pv.param = "LogProtocolErrors";
pvi = find(s.moduleParams.begin(), s.moduleParams.end(), pv);
///////////////////////////
pv.param = "LogProtocolErrors";
pvi = find(s.moduleParams.begin(), s.moduleParams.end(), pv);
-if (pvi == s.moduleParams.end())
+if (pvi == s.moduleParams.end()
|| pvi->value.empty()
)
logProtocolErrors = false;
else if (ParseYesNo(pvi->value[0], &logProtocolErrors))
{
logProtocolErrors = false;
else if (ParseYesNo(pvi->value[0], &logProtocolErrors))
{
@@
-147,7
+147,7
@@
std::string freeMbType;
int n = 0;
pv.param = "FreeMb";
pvi = find(s.moduleParams.begin(), s.moduleParams.end(), pv);
int n = 0;
pv.param = "FreeMb";
pvi = find(s.moduleParams.begin(), s.moduleParams.end(), pv);
-if (pvi == s.moduleParams.end())
+if (pvi == s.moduleParams.end()
|| pvi->value.empty()
)
{
errorStr = "Parameter \'FreeMb\' not found.";
printfd(__FILE__, "Parameter 'FreeMb' not found\n");
{
errorStr = "Parameter \'FreeMb\' not found.";
printfd(__FILE__, "Parameter 'FreeMb' not found\n");
@@
-188,15
+188,13
@@
return 0;
#ifdef IA_PHASE_DEBUG
IA_PHASE::IA_PHASE()
: phase(1),
#ifdef IA_PHASE_DEBUG
IA_PHASE::IA_PHASE()
: phase(1),
- phaseTime(),
flog(NULL)
{
gettimeofday(&phaseTime, NULL);
}
#else
IA_PHASE::IA_PHASE()
flog(NULL)
{
gettimeofday(&phaseTime, NULL);
}
#else
IA_PHASE::IA_PHASE()
- : phase(1),
- phaseTime()
+ : phase(1)
{
gettimeofday(&phaseTime, NULL);
}
{
gettimeofday(&phaseTime, NULL);
}
@@
-526,21
+524,19
@@
if (ret)
return ret;
}
//-----------------------------------------------------------------------------
return ret;
}
//-----------------------------------------------------------------------------
-int AUTH_IA::Reload()
+int AUTH_IA::Reload(
const MODULE_SETTINGS & ms
)
{
AUTH_IA_SETTINGS newIaSettings;
{
AUTH_IA_SETTINGS newIaSettings;
-MODULE_SETTINGS newSettings = settings;
-if (newIaSettings.ParseSettings(newSettings))
+if (newIaSettings.ParseSettings(ms))
{
{
- STG_LOGGER & WriteServLog = GetStgLogger();
printfd(__FILE__, "AUTH_IA::Reload() - Failed to reload InetAccess.\n");
printfd(__FILE__, "AUTH_IA::Reload() - Failed to reload InetAccess.\n");
-
WriteServLog
("AUTH_IA: Cannot reload InetAccess. Errors found.");
+
logger
("AUTH_IA: Cannot reload InetAccess. Errors found.");
return -1;
}
return -1;
}
-STG_LOGGER & WriteServLog = GetStgLogger();
printfd(__FILE__, "AUTH_IA::Reload() - Reloaded InetAccess successfully.\n");
printfd(__FILE__, "AUTH_IA::Reload() - Reloaded InetAccess successfully.\n");
-WriteServLog("AUTH_IA: Reloaded InetAccess successfully.");
+logger("AUTH_IA: Reloaded InetAccess successfully.");
+iaSettings = newIaSettings;
return 0;
}
//-----------------------------------------------------------------------------
return 0;
}
//-----------------------------------------------------------------------------