From e26acd5c11c5c730dcad9c824d5d94175918fad3 Mon Sep 17 00:00:00 2001 From: Vitalii Koshura Date: Tue, 9 Oct 2018 00:37:22 +0300 Subject: [PATCH 1/3] NeedRunDaemon option should be applied when connecting to localhost only. This commit fixes a situation when trying to connect to remote client with option 'Run client' on leads to unability to connect to selected client. Signed-off-by: Vitalii Koshura --- clientgui/MainDocument.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/clientgui/MainDocument.cpp b/clientgui/MainDocument.cpp index 12abdfed93..79c6b5c8f8 100644 --- a/clientgui/MainDocument.cpp +++ b/clientgui/MainDocument.cpp @@ -586,19 +586,17 @@ int CMainDocument::OnPoll() { pFrame->OnExit(event); // Exit if Select Computer dialog cancelled } } - } - - if (wxGetApp().GetNeedRunDaemon()) { - if (IsComputerNameLocal(hostName)) { + if (wxGetApp().GetNeedRunDaemon()) { if (m_pClientManager->StartupBOINCCore()) { Connect(wxT("localhost"), portNum, password, TRUE, TRUE); - } else { + } + else { m_pNetworkConnection->ForceDisconnect(); pFrame->ShowDaemonStartFailedAlert(); } - } else { - Connect(hostName, portNum, password, TRUE, password.IsEmpty()); } + } else { + Connect(hostName, portNum, password, TRUE, password.IsEmpty()); } } From ebca06234ab4110d39ebe00bc8ae6bb32672e08c Mon Sep 17 00:00:00 2001 From: Vitalii Koshura Date: Mon, 15 Oct 2018 22:25:41 +0300 Subject: [PATCH 2/3] Fix initial connection when launch new instance of Manager Signed-off-by: Vitalii Koshura --- clientgui/MainDocument.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/clientgui/MainDocument.cpp b/clientgui/MainDocument.cpp index 79c6b5c8f8..7a89f45173 100644 --- a/clientgui/MainDocument.cpp +++ b/clientgui/MainDocument.cpp @@ -586,14 +586,15 @@ int CMainDocument::OnPoll() { pFrame->OnExit(event); // Exit if Select Computer dialog cancelled } } - if (wxGetApp().GetNeedRunDaemon()) { - if (m_pClientManager->StartupBOINCCore()) { - Connect(wxT("localhost"), portNum, password, TRUE, TRUE); - } - else { - m_pNetworkConnection->ForceDisconnect(); - pFrame->ShowDaemonStartFailedAlert(); - } + } + + if (wxGetApp().GetNeedRunDaemon() && IsComputerNameLocal(hostName)) { + if (m_pClientManager->StartupBOINCCore()) { + Connect(wxT("localhost"), portNum, password, TRUE, TRUE); + } + else { + m_pNetworkConnection->ForceDisconnect(); + pFrame->ShowDaemonStartFailedAlert(); } } else { Connect(hostName, portNum, password, TRUE, password.IsEmpty()); From 0419cc929c331f9837df62527c472e4428f82392 Mon Sep 17 00:00:00 2001 From: Vitalii Koshura Date: Wed, 24 Oct 2018 01:39:52 +0300 Subject: [PATCH 3/3] Fix 'Run client' feature for local connection Signed-off-by: Vitalii Koshura --- clientgui/MainDocument.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clientgui/MainDocument.cpp b/clientgui/MainDocument.cpp index 7a89f45173..82cefa6d94 100644 --- a/clientgui/MainDocument.cpp +++ b/clientgui/MainDocument.cpp @@ -651,7 +651,7 @@ int CMainDocument::ResetState() { int CMainDocument::Connect(const wxString& szComputer, int iPort, const wxString& szComputerPassword, const bool bDisconnect, const bool bUseDefaultPassword) { - if (IsComputerNameLocal(szComputer)) { + if (wxGetApp().GetNeedRunDaemon() && IsComputerNameLocal(szComputer)) { // Restart client if not already running m_pClientManager->AutoRestart(); }