diff --git a/client/common/cmdline.c b/client/common/cmdline.c index 8228b4c46..4c8a400b8 100644 --- a/client/common/cmdline.c +++ b/client/common/cmdline.c @@ -168,6 +168,7 @@ static COMMAND_LINE_ARGUMENT_A args[] = { "play-rfx", COMMAND_LINE_VALUE_REQUIRED, "", 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, "", NULL, NULL, -1, NULL, "Automatic reconnection maximum retries [1,1000]" }, { "reconnect-cookie", COMMAND_LINE_VALUE_REQUIRED, "", 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);