]> git.stg.codes - stg.git/blobdiff - projects/stargazer/plugins/authorization/inetaccess/inetaccess.cpp
Simplified STG_LOCKER.
[stg.git] / projects / stargazer / plugins / authorization / inetaccess / inetaccess.cpp
index 5a15a10aea91cfee72d1614d068c73bab3d61a4c..03e304227ace7b74dc46343bb5687b27f68e6b75 100644 (file)
@@ -77,7 +77,8 @@ AUTH_IA_SETTINGS::AUTH_IA_SETTINGS()
       userTimeout(0),
       port(0),
       errorStr(),
-      freeMbShowType(freeMbCash)
+      freeMbShowType(freeMbCash),
+      logProtocolErrors(false)
 {
 }
 //-----------------------------------------------------------------------------
@@ -285,15 +286,6 @@ phase = 4;
 gettimeofday(&phaseTime, NULL);
 }
 //-----------------------------------------------------------------------------
-void IA_PHASE::SetPhase5()
-{
-#ifdef IA_PHASE_DEBUG
-WritePhaseChange(5);
-#endif
-phase = 5;
-gettimeofday(&phaseTime, NULL);
-}
-//-----------------------------------------------------------------------------
 int IA_PHASE::GetPhase() const
 {
 return phase;
@@ -692,15 +684,14 @@ return 0;
 //-----------------------------------------------------------------------------
 int AUTH_IA::Timeouter()
 {
-STG_LOCKER lock(&mutex, __FILE__, __LINE__);
+STG_LOCKER lock(&mutex);
 
 std::map<uint32_t, IA_USER>::iterator it;
 it = ip2user.begin();
-uint32_t sip;
 
 while (it != ip2user.end())
     {
-    sip = it->first;
+    uint32_t sip = it->first;
 
     static UTIME currTime;
     gettimeofday(&currTime, NULL);
@@ -780,7 +771,7 @@ int AUTH_IA::PacketProcessor(void * buff, size_t dataLen, uint32_t sip, uint16_t
 std::string login(user->GetLogin());
 const size_t offset = LOGIN_LEN + 2 + 6; // LOGIN_LEN + sizeOfMagic + sizeOfVer;
 
-STG_LOCKER lock(&mutex, __FILE__, __LINE__);
+STG_LOCKER lock(&mutex);
 std::map<uint32_t, IA_USER>::iterator it(ip2user.find(sip));
 
 if (it == ip2user.end())
@@ -967,7 +958,7 @@ if (!ip)
 
 std::map<uint32_t, IA_USER>::iterator it;
 
-STG_LOCKER lock(&mutex, __FILE__, __LINE__);
+STG_LOCKER lock(&mutex);
 it = ip2user.find(ip);
 if (it == ip2user.end())
     {
@@ -1055,7 +1046,7 @@ printfd(__FILE__, "SendMessage userIP=%s\n", inet_ntostring(ip).c_str());
 
 std::map<uint32_t, IA_USER>::iterator it;
 
-STG_LOCKER lock(&mutex, __FILE__, __LINE__);
+STG_LOCKER lock(&mutex);
 it = ip2user.find(ip);
 if (it == ip2user.end())
     {
@@ -1170,7 +1161,7 @@ int AUTH_IA::Process_CONN_SYN_8(CONN_SYN_8 * connSyn, IA_USER * iaUser, uint32_t
 #ifdef ARCH_BE
 SwapBytes(connSyn->dirs);
 #endif
-int ret = Process_CONN_SYN_6((CONN_SYN_6*)connSyn, iaUser, sip);
+int ret = Process_CONN_SYN_6(reinterpret_cast<CONN_SYN_6 *>(connSyn), iaUser, sip);
 enabledDirs = connSyn->dirs;
 return ret;
 }