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:
		
							parent
							
								
									c09623459b
								
							
						
					
					
						commit
						fe4305e41c
					
				| @ -52,17 +52,19 @@ size_t TUserTable::GetLicenses() const | |||||||
| { | { | ||||||
| 	THostSet hsHosts; | 	THostSet hsHosts; | ||||||
|   for( TUsersHashMap::const_iterator it = begin(); it != end(); ++it ) |   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(); | 	return hsHosts.size(); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| wxString TUserTable::BuildKey(wxSocketBase& sock, const wxChar* user, int session) const | wxString TUserTable::BuildKey(wxSocketBase& sock, const wxChar* user, int session) const | ||||||
| { | { | ||||||
|   wxIPV4address peer; sock.GetPeer(peer); |   wxIPV4address peer; sock.GetPeer(peer); | ||||||
|   wxString host; |  | ||||||
|   host.Printf("%s:%d", peer.Hostname().c_str(), session); |  | ||||||
|   wxString strUserAtHost; |   wxString strUserAtHost; | ||||||
|   strUserAtHost.Printf("%s@%s", user, host.c_str()); |   strUserAtHost.Printf("%s@%s:%d", user, peer.Hostname().c_str(), session); | ||||||
|   return strUserAtHost; |   return strUserAtHost; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| @ -110,6 +112,8 @@ bool TUserTable::Kill(TUserInfo* ui) | |||||||
|     if (it->second == ui) |     if (it->second == ui) | ||||||
|     { |     { | ||||||
|       erase(it); |       erase(it); | ||||||
|  |       if (GetLicenses() == 0) | ||||||
|  |         clear(); | ||||||
|       return true; |       return true; | ||||||
|     } |     } | ||||||
|   } |   } | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user