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 <lestat.de.lionkur@gmail.com>
This commit is contained in:
Vitalii Koshura 2018-10-09 00:37:22 +03:00
parent 650127da84
commit e26acd5c11
No known key found for this signature in database
GPG Key ID: CE0DB1726070A5A3
1 changed files with 5 additions and 7 deletions

View File

@ -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());
}
}