Merge pull request #3679 from akallabeth/auto_reconnect_infinite

AutoReconnect support unlimited retries.
This commit is contained in:
Martin Fleisz 2017-01-09 14:20:11 +01:00 committed by GitHub
commit 3787c9d3a4
2 changed files with 3 additions and 3 deletions

View File

@ -1410,7 +1410,7 @@ static BOOL xf_auto_reconnect(freerdp* instance)
while (TRUE)
{
/* Quit retrying if max retries has been exceeded */
if (numRetries++ >= maxRetries)
if ((maxRetries > 0) && (numRetries++ >= maxRetries))
{
return FALSE;
}

View File

@ -168,7 +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]" },
{ "auto-reconnect-max-retries", COMMAND_LINE_VALUE_REQUIRED, "<retries>", NULL, NULL, -1, NULL, "Automatic reconnection maximum retries, 0 for unlimited [0,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" },
@ -2366,7 +2366,7 @@ int freerdp_client_settings_parse_command_line_arguments(rdpSettings* settings,
{
settings->AutoReconnectMaxRetries = atoi(arg->Value);
if ((settings->AutoReconnectMaxRetries == 0) ||
if ((settings->AutoReconnectMaxRetries < 0) ||
(settings->AutoReconnectMaxRetries > 1000))
return COMMAND_LINE_ERROR;
}