Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/SoftEtherVPN/SoftEtherVPN_Stable.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorELIN <elin@mikomoe.jp>2014-01-28 09:30:57 +0400
committerELIN <elin@mikomoe.jp>2014-01-28 09:30:57 +0400
commit504c2eb483726e2982cabc87924e245aa59c4d5d (patch)
tree4d40023a70db5f3e11fd98040b3d9ed758c1d563
parent001fd910fedfd0ef1690a9d3c50c1a28d1680d1d (diff)
possible to provide hostname with an argument
-rw-r--r--src/Cedar/CM.c48
1 files changed, 29 insertions, 19 deletions
diff --git a/src/Cedar/CM.c b/src/Cedar/CM.c
index cef8113a..43a3c93a 100644
--- a/src/Cedar/CM.c
+++ b/src/Cedar/CM.c
@@ -11799,33 +11799,43 @@ RETRY:
void MainCM()
{
// If there is /remote in the argument, show the screen of the remote connection
- char *cmdline = GetCommandLineStr();
+ TOKEN_LIST *cmdline = GetCommandLineToken();
- if (StrCmpi(cmdline, "/remote") == 0)
+ if (cmdline->NumTokens >= 1)
{
- char *hostname = RemoteDlg(NULL, CM_REG_KEY, ICO_VPN, _UU("CM_TITLE"), _UU("CM_REMOTE_TITLE"), NULL);
- if (hostname == NULL)
+ if (StrCmpi(cmdline->Token[0], "/remote") == 0)
{
- return;
- }
- if (cm->server_name != NULL)
- {
- Free(cm->server_name);
+ if (cmdline->NumTokens >= 2)
+ {
+ cm->server_name = CopyStr(cmdline->Token[1]);
+ }
+ else
+ {
+ char *hostname = RemoteDlg(NULL, CM_REG_KEY, ICO_VPN, _UU("CM_TITLE"), _UU("CM_REMOTE_TITLE"), NULL);
+ if (hostname == NULL)
+ {
+ return;
+ }
+ if (cm->server_name != NULL)
+ {
+ Free(cm->server_name);
+ }
+ cm->server_name = NULL;
+ if (StrCmpi(hostname, "localhost") != 0 && StrCmpi(hostname, "127.0.0.1") != 0 )
+ {
+ cm->server_name = hostname;
+ }
+ }
}
- cm->server_name = NULL;
- if (StrCmpi(hostname, "localhost") != 0 && StrCmpi(hostname, "127.0.0.1") != 0 )
+
+ if (StrCmpi(cmdline->Token[0], "/startup") == 0)
{
- cm->server_name = hostname;
+ // Startup mode
+ cm->StartupMode = true;
}
}
- if (StrCmpi(cmdline, "/startup") == 0)
- {
- // Startup mode
- cm->StartupMode = true;
- }
-
- Free(cmdline);
+ FreeToken(cmdline);
if (IsZero(cm->ShortcutKey, SHA1_SIZE) == false)
{