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 construction else added to if (tariff != NULL) construction in the
[stg.git]
/
projects
/
stargazer
/
plugins
/
other
/
ping
/
ping.cpp
diff --git
a/projects/stargazer/plugins/other/ping/ping.cpp
b/projects/stargazer/plugins/other/ping/ping.cpp
index 7c4050abb035d9f55108ed306b02d5b51e869a3d..bec692fa400e48bf8fc2a08c9d3b08efa473a98f 100644
(file)
--- a/
projects/stargazer/plugins/other/ping/ping.cpp
+++ b/
projects/stargazer/plugins/other/ping/ping.cpp
@@
-50,7
+50,7
@@
std::vector<PARAM_VALUE>::const_iterator pvi;
pv.param = "PingDelay";
pvi = std::find(s.moduleParams.begin(), s.moduleParams.end(), pv);
pv.param = "PingDelay";
pvi = std::find(s.moduleParams.begin(), s.moduleParams.end(), pv);
-if (pvi == s.moduleParams.end())
+if (pvi == s.moduleParams.end()
|| pvi->value.empty()
)
{
errorStr = "Parameter \'PingDelay\' not found.";
printfd(__FILE__, "Parameter 'PingDelay' not found\n");
{
errorStr = "Parameter \'PingDelay\' not found.";
printfd(__FILE__, "Parameter 'PingDelay' not found\n");
@@
-67,18
+67,9
@@
return 0;
}
//-----------------------------------------------------------------------------
PING::PING()
}
//-----------------------------------------------------------------------------
PING::PING()
- : errorStr(),
- pingSettings(),
- settings(),
- users(NULL),
- usersList(),
- thread(),
- mutex(),
+ : users(NULL),
nonstop(false),
isRunning(false),
nonstop(false),
isRunning(false),
- pinger(),
- ChgCurrIPNotifierList(),
- ChgIPNotifierList(),
onAddUserNotifier(*this),
onDelUserNotifier(*this),
logger(GetPluginLogger(GetStgLogger(), "ping"))
onAddUserNotifier(*this),
onDelUserNotifier(*this),
logger(GetPluginLogger(GetStgLogger(), "ping"))
@@
-124,7
+115,7
@@
return 0;
//-----------------------------------------------------------------------------
int PING::Stop()
{
//-----------------------------------------------------------------------------
int PING::Stop()
{
-STG_LOCKER lock(&mutex
, __FILE__, __LINE__
);
+STG_LOCKER lock(&mutex);
if (!isRunning)
return 0;
if (!isRunning)
return 0;
@@
-178,7
+169,7
@@
while (ping->nonstop)
{
std::list<USER_PTR>::iterator iter = ping->usersList.begin();
{
{
std::list<USER_PTR>::iterator iter = ping->usersList.begin();
{
- STG_LOCKER lock(&ping->mutex
, __FILE__, __LINE__
);
+ STG_LOCKER lock(&ping->mutex);
while (iter != ping->usersList.end())
{
if ((*iter)->GetProperty().ips.ConstData().OnlyOneIP())
while (iter != ping->usersList.end())
{
if ((*iter)->GetProperty().ips.ConstData().OnlyOneIP())
@@
-268,7
+259,7
@@
if (IPIter != ChgIPNotifierList.end())
//-----------------------------------------------------------------------------
void PING::GetUsers()
{
//-----------------------------------------------------------------------------
void PING::GetUsers()
{
-STG_LOCKER lock(&mutex
, __FILE__, __LINE__
);
+STG_LOCKER lock(&mutex);
USER_PTR u;
int h = users->OpenSearch();
USER_PTR u;
int h = users->OpenSearch();
@@
-297,7
+288,7
@@
users->CloseSearch(h);
//-----------------------------------------------------------------------------
void PING::AddUser(USER_PTR u)
{
//-----------------------------------------------------------------------------
void PING::AddUser(USER_PTR u)
{
-STG_LOCKER lock(&mutex
, __FILE__, __LINE__
);
+STG_LOCKER lock(&mutex);
SetUserNotifiers(u);
usersList.push_back(u);
SetUserNotifiers(u);
usersList.push_back(u);
@@
-305,7
+296,7
@@
usersList.push_back(u);
//-----------------------------------------------------------------------------
void PING::DelUser(USER_PTR u)
{
//-----------------------------------------------------------------------------
void PING::DelUser(USER_PTR u)
{
-STG_LOCKER lock(&mutex
, __FILE__, __LINE__
);
+STG_LOCKER lock(&mutex);
UnSetUserNotifiers(u);
UnSetUserNotifiers(u);