+void PROTO::CheckTimeouts()
+{
+STG_LOCKER lock(&mutex);
+std::list<std::pair<uint32_t, USER> >::iterator it;
+for (it = users.begin(); it != users.end(); ++it)
+ {
+ int delta = difftime(time(NULL), it->second.GetPhaseChangeTime());
+ if ((it->second.GetPhase() == 3) &&
+ (delta > it->second.GetUserTimeout()))
+ {
+ printfd(__FILE__, "PROTO::CheckTimeouts() - user alive timeout (ip: %s, login: '%s', delta: %d > %d)\n", inet_ntostring(it->second.GetIP()).c_str(), it->second.GetLogin().c_str(), delta, it->second.GetUserTimeout());
+ it->second.SetPhase(1);
+ }
+ if ((it->second.GetPhase() == 2) &&
+ (delta > it->second.GetAliveTimeout()))
+ {
+ printfd(__FILE__, "PROTO::CheckTimeouts() - user connect timeout (ip: %s, login: '%s', delta: %d > %d)\n", inet_ntostring(it->second.GetIP()).c_str(), it->second.GetLogin().c_str(), delta, it->second.GetAliveTimeout());
+ it->second.SetPhase(1);
+ }
+ }
+}
+