AutoReconnect support unlimited retries.
authorArmin Novak <armin.novak@thincast.com>
Mon, 9 Jan 2017 11:34:09 +0000 (12:34 +0100)
committerArmin Novak <armin.novak@thincast.com>
Mon, 9 Jan 2017 11:34:09 +0000 (12:34 +0100)
client/X11/xf_client.c
client/common/cmdline.c

index f125b2d..7073adb 100644 (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;
                }
index 4c8a400..d700675 100644 (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;
                }