From e26acd5c11c5c730dcad9c824d5d94175918fad3 Mon Sep 17 00:00:00 2001 From: Vitalii Koshura Date: Tue, 9 Oct 2018 00:37:22 +0300 Subject: [PATCH] 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()); } }