- MGR: Only detect if the host name is local once per connection.

clientgui/
        MainDocument.cpp, .h

svn path=/trunk/boinc/; revision=12911
This commit is contained in:
Rom Walton 2007-06-12 20:29:58 +00:00
parent ff999f983d
commit 239406c6fa
3 changed files with 26 additions and 11 deletions

View File

@ -6155,3 +6155,9 @@ Rom 12 June 2007
clientgui/
AdvancedFrame.cpp
BOINCGUIApp.cpp
Rom 12 June 2007
- MGR: Only detect if the host name is local once per connection.
clientgui/
MainDocument.cpp, .h

View File

@ -53,6 +53,7 @@ CNetworkConnection::CNetworkConnection(CMainDocument* pDocument) :
m_bReconnectOnError = false;
m_bNewConnection = false;
m_bUsedDefaultPassword = false;
m_bIdentifyHostType = true;
}
@ -186,18 +187,24 @@ int CNetworkConnection::GetConnectingComputerName(wxString& strMachine) {
bool CNetworkConnection::IsComputerNameLocal(const wxString& strMachine) {
if (strMachine.empty()) {
return true;
} else if (wxT("localhost") == strMachine.Lower()) {
return true;
} else if (wxT("localhost.localdomain") == strMachine.Lower()) {
return true;
} else if (::wxGetHostName().Lower() == strMachine.Lower()) {
return true;
} else if (::wxGetFullHostName().Lower() == strMachine.Lower()) {
return true;
static bool bLocalHostName = true;
if (m_bIdentifyHostType) {
if (strMachine.empty()) {
bLocalHostName = true;
} else if (wxT("localhost") == strMachine.Lower()) {
bLocalHostName = true;
} else if (wxT("localhost.localdomain") == strMachine.Lower()) {
bLocalHostName = true;
} else if (::wxGetHostName().Lower() == strMachine.Lower()) {
bLocalHostName = true;
} else if (::wxGetFullHostName().Lower() == strMachine.Lower()) {
bLocalHostName = true;
}
m_bIdentifyHostType = false;
}
return false;
return bLocalHostName;
}
@ -207,6 +214,7 @@ int CNetworkConnection::SetComputer(const wxChar* szComputer, const wxChar* szPa
m_bUseDefaultPassword = FALSE;
m_bNewConnection = true;
m_bIdentifyHostType = true;
m_strNewComputerName = szComputer;
m_strNewComputerPassword = szPassword;
m_bUseDefaultPassword = bUseDefaultPassword;

View File

@ -64,6 +64,7 @@ private:
bool m_bUseDefaultPassword;
bool m_bUsedDefaultPassword;
bool m_bNewConnection;
bool m_bIdentifyHostType;
wxString m_strNewComputerName;
wxString m_strNewComputerPassword;
wxString m_strConnectedComputerName;