diff --git a/checkin_notes b/checkin_notes index 951068903c..c05114d22e 100755 --- a/checkin_notes +++ b/checkin_notes @@ -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 diff --git a/clientgui/MainDocument.cpp b/clientgui/MainDocument.cpp index 0fbe6302cd..df56e6018f 100644 --- a/clientgui/MainDocument.cpp +++ b/clientgui/MainDocument.cpp @@ -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; diff --git a/clientgui/MainDocument.h b/clientgui/MainDocument.h index ee557f1ad8..33b5353717 100644 --- a/clientgui/MainDocument.h +++ b/clientgui/MainDocument.h @@ -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;