From 05f8f37888093c10e84f259f610d2b58eebc31d7 Mon Sep 17 00:00:00 2001 From: crs Date: Sun, 12 Jan 2003 16:35:54 +0000 Subject: [PATCH] Added test of using the client's own name as the server name with an appropriate error message. --- cmd/launcher/launcher.cpp | 12 ++++++++++++ cmd/launcher/launcher.rc | 1 + 2 files changed, 13 insertions(+) diff --git a/cmd/launcher/launcher.cpp b/cmd/launcher/launcher.cpp index 0b17b224..7a4f4894 100644 --- a/cmd/launcher/launcher.cpp +++ b/cmd/launcher/launcher.cpp @@ -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"; } diff --git a/cmd/launcher/launcher.rc b/cmd/launcher/launcher.rc index 6091c59f..35974cc1 100644 --- a/cmd/launcher/launcher.rc +++ b/cmd/launcher/launcher.rc @@ -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