Added test of using the client's own name as the server name

with an appropriate error message.
This commit is contained in:
crs 2003-01-12 16:35:54 +00:00
parent 6c56f8a9fc
commit 05f8f37888
2 changed files with 13 additions and 0 deletions

View File

@ -514,6 +514,18 @@ getCommandLine(HWND hwnd, bool testing)
return CString();
}
// compare server name to local host. a common error
// is to provide the client's name for the server. we
// don't bother to check the addresses though that'd be
// more accurate.
if (CStringUtil::CaselessCmp::equal(ARCH->getHostName(), server)) {
showError(hwnd, CStringUtil::format(
getString(IDS_SERVER_IS_CLIENT).c_str(),
server.c_str()));
SetFocus(child);
return CString();
}
if (testing) {
cmdLine += " --no-camp";
}

View File

@ -254,6 +254,7 @@ BEGIN
IDS_UNINSTALLED_USER "Removed auto-start. Synergy will not automatically start each time you log in."
IDS_INVALID_SERVER_NAME "Server name `%{1}' is invalid."
IDS_TITLE "Synergy - Version %{1}"
IDS_SERVER_IS_CLIENT "Please enter the computer name of the synergy server, not\nthe name of this computer, in the Server Host Name field."
END
#endif // English (U.S.) resources