Merge pull request #3657 from akallabeth/auto_reconnect_max_retry_support

New argument /auto-reconnect-max-retries:<retries>
This commit is contained in:
Martin Fleisz 2016-12-19 13:14:30 +01:00 committed by GitHub
commit 8d0809cf26

View File

@ -168,6 +168,7 @@ static COMMAND_LINE_ARGUMENT_A args[] =
{ "play-rfx", COMMAND_LINE_VALUE_REQUIRED, "<pcap file>", NULL, NULL, -1, NULL, "Replay rfx pcap file" },
{ "auth-only", COMMAND_LINE_VALUE_BOOL, NULL, BoolValueFalse, NULL, -1, NULL, "Authenticate only." },
{ "auto-reconnect", COMMAND_LINE_VALUE_BOOL, NULL, BoolValueFalse, NULL, -1, NULL, "Automatic reconnection" },
{ "auto-reconnect-max-retries", COMMAND_LINE_VALUE_REQUIRED, "<retries>", NULL, NULL, -1, NULL, "Automatic reconnection maximum retries [1,1000]" },
{ "reconnect-cookie", COMMAND_LINE_VALUE_REQUIRED, "<base64 cookie>", NULL, NULL, -1, NULL, "Pass base64 reconnect cookie to the connection" },
{ "print-reconnect-cookie", COMMAND_LINE_VALUE_BOOL, NULL, BoolValueFalse, NULL, -1, NULL, "Print base64 reconnect cookie after connecting" },
{ "heartbeat", COMMAND_LINE_VALUE_BOOL, NULL, BoolValueFalse, NULL, -1, NULL, "Support heartbeat PDUs" },
@ -2309,6 +2310,7 @@ int freerdp_client_settings_parse_command_line_arguments(rdpSettings* settings,
CommandLineSwitchCase(arg, "max-loop-time")
{
settings->MaxTimeInCheckLoop = atoi(arg->Value);
if ((long) settings->MaxTimeInCheckLoop < 0)
{
WLog_ERR(TAG, "invalid max loop time: %s", arg->Value);
@ -2360,6 +2362,14 @@ int freerdp_client_settings_parse_command_line_arguments(rdpSettings* settings,
{
settings->AutoReconnectionEnabled = arg->Value ? TRUE : FALSE;
}
CommandLineSwitchCase(arg, "auto-reconnect-max-retries")
{
settings->AutoReconnectMaxRetries = atoi(arg->Value);
if ((settings->AutoReconnectMaxRetries == 0) ||
(settings->AutoReconnectMaxRetries > 1000))
return COMMAND_LINE_ERROR;
}
CommandLineSwitchCase(arg, "reconnect-cookie")
{
BYTE* base64;
@ -2523,9 +2533,8 @@ static BOOL freerdp_client_load_static_channel_addin(rdpChannels* channels,
{
PVIRTUALCHANNELENTRY entry = NULL;
PVIRTUALCHANNELENTRYEX entryEx = NULL;
entryEx = (PVIRTUALCHANNELENTRYEX) freerdp_load_channel_addin_entry(name, NULL, NULL,
FREERDP_ADDIN_CHANNEL_STATIC | FREERDP_ADDIN_CHANNEL_ENTRYEX);
FREERDP_ADDIN_CHANNEL_STATIC | FREERDP_ADDIN_CHANNEL_ENTRYEX);
if (!entryEx)
entry = freerdp_load_channel_addin_entry(name, NULL, NULL, FREERDP_ADDIN_CHANNEL_STATIC);