]> git.stg.codes - stg.git/blobdiff - projects/stargazer/plugins/other/ping/ping.cpp
stg-2.409 pre-merge.
[stg.git] / projects / stargazer / plugins / other / ping / ping.cpp
index 7c4050abb035d9f55108ed306b02d5b51e869a3d..bec692fa400e48bf8fc2a08c9d3b08efa473a98f 100644 (file)
@@ -50,7 +50,7 @@ std::vector<PARAM_VALUE>::const_iterator pvi;
 
 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");
@@ -67,18 +67,9 @@ return 0;
 }
 //-----------------------------------------------------------------------------
 PING::PING()
-    : errorStr(),
-      pingSettings(),
-      settings(),
-      users(NULL),
-      usersList(),
-      thread(),
-      mutex(),
+    : users(NULL),
       nonstop(false),
       isRunning(false),
-      pinger(),
-      ChgCurrIPNotifierList(),
-      ChgIPNotifierList(),
       onAddUserNotifier(*this),
       onDelUserNotifier(*this),
       logger(GetPluginLogger(GetStgLogger(), "ping"))
@@ -124,7 +115,7 @@ return 0;
 //-----------------------------------------------------------------------------
 int PING::Stop()
 {
-STG_LOCKER lock(&mutex, __FILE__, __LINE__);
+STG_LOCKER lock(&mutex);
 
 if (!isRunning)
     return 0;
@@ -178,7 +169,7 @@ while (ping->nonstop)
     {
     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())
@@ -268,7 +259,7 @@ if (IPIter != ChgIPNotifierList.end())
 //-----------------------------------------------------------------------------
 void PING::GetUsers()
 {
-STG_LOCKER lock(&mutex, __FILE__, __LINE__);
+STG_LOCKER lock(&mutex);
 
 USER_PTR u;
 int h = users->OpenSearch();
@@ -297,7 +288,7 @@ users->CloseSearch(h);
 //-----------------------------------------------------------------------------
 void PING::AddUser(USER_PTR u)
 {
-STG_LOCKER lock(&mutex, __FILE__, __LINE__);
+STG_LOCKER lock(&mutex);
 
 SetUserNotifiers(u);
 usersList.push_back(u);
@@ -305,7 +296,7 @@ usersList.push_back(u);
 //-----------------------------------------------------------------------------
 void PING::DelUser(USER_PTR u)
 {
-STG_LOCKER lock(&mutex, __FILE__, __LINE__);
+STG_LOCKER lock(&mutex);
 
 UnSetUserNotifiers(u);