From 453372a4bf0d187b11937f854c12010480a4d349 Mon Sep 17 00:00:00 2001 From: akallabeth Date: Mon, 23 Mar 2020 08:51:35 +0100 Subject: [PATCH] Add option to adjust the tcp ack timeout On high latency links the default of 9 second timeout might be too strict. Adjusting this for all users will result in a long time for connections to fail, so let these with high latency links adjust the value manually. --- client/common/cmdline.c | 7 +++++++ client/common/cmdline.h | 3 +++ 2 files changed, 10 insertions(+) diff --git a/client/common/cmdline.c b/client/common/cmdline.c index e732e21b2..12931de9a 100644 --- a/client/common/cmdline.c +++ b/client/common/cmdline.c @@ -2434,6 +2434,13 @@ int freerdp_client_settings_parse_command_line_arguments(rdpSettings* settings, { settings->DisableThemes = !enable; } + CommandLineSwitchCase(arg, "timeout") + { + ULONGLONG val; + if (!value_to_uint(arg->Value, &val, 1, 600000)) + return COMMAND_LINE_ERROR_UNEXPECTED_VALUE; + settings->TcpAckTimeout = (UINT32)val; + } CommandLineSwitchCase(arg, "aero") { settings->AllowDesktopComposition = enable; diff --git a/client/common/cmdline.h b/client/common/cmdline.h index 16e79371e..8133d2b8d 100644 --- a/client/common/cmdline.h +++ b/client/common/cmdline.h @@ -334,6 +334,9 @@ static const COMMAND_LINE_ARGUMENT_A args[] = { "SSH Agent forwarding channel" }, { "t", COMMAND_LINE_VALUE_REQUIRED, "", NULL, NULL, -1, "title", "Window title" }, { "themes", COMMAND_LINE_VALUE_BOOL, NULL, BoolValueTrue, NULL, -1, NULL, "themes" }, + { "timeout", COMMAND_LINE_VALUE_REQUIRED, "<time in ms>", "9000", NULL, -1, "timeout", + "Advanced setting for high latency links: Adjust connection timeout, use if you encounter " + "timeout failures with your connection" }, { "tls-ciphers", COMMAND_LINE_VALUE_REQUIRED, "[netmon|ma|ciphers]", NULL, NULL, -1, NULL, "Allowed TLS ciphers" }, { "tls-seclevel", COMMAND_LINE_VALUE_REQUIRED, "<level>", "1", NULL, -1, NULL,