Patch level : 10.0

Files correlati     : authoriz.exe
Ricompilazione Demo : [ ]
Commento            :
Migliorato conteggio licenze in uso


git-svn-id: svn://10.65.10.50/branches/R_10_00@22430 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2011-09-28 08:25:33 +00:00
parent c09623459b
commit fe4305e41c

View File

@ -52,17 +52,19 @@ size_t TUserTable::GetLicenses() const
{
THostSet hsHosts;
for( TUsersHashMap::const_iterator it = begin(); it != end(); ++it )
hsHosts.insert(it->first);
{
TUserInfo* ui = it->second;
if (ui != NULL)
hsHosts.insert(ui->m_strHost);
}
return hsHosts.size();
}
wxString TUserTable::BuildKey(wxSocketBase& sock, const wxChar* user, int session) const
{
wxIPV4address peer; sock.GetPeer(peer);
wxString host;
host.Printf("%s:%d", peer.Hostname().c_str(), session);
wxString strUserAtHost;
strUserAtHost.Printf("%s@%s", user, host.c_str());
strUserAtHost.Printf("%s@%s:%d", user, peer.Hostname().c_str(), session);
return strUserAtHost;
}
@ -110,6 +112,8 @@ bool TUserTable::Kill(TUserInfo* ui)
if (it->second == ui)
{
erase(it);
if (GetLicenses() == 0)
clear();
return true;
}
}