From ab5be61e892bf47c684d878ad7e80fadd0e38790 Mon Sep 17 00:00:00 2001 From: akallabeth Date: Mon, 20 Feb 2023 13:26:44 +0100 Subject: [PATCH] [client,common] working REDIRECTION_VERSION6 * REDIRECTION_VERSION6 requires enabled multitransport, enable it * Add a fallback if multitransport was disabled --- client/common/cmdline.h | 2 +- libfreerdp/core/gcc.c | 10 ++++++++++ libfreerdp/core/settings.c | 10 ++++++++-- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/client/common/cmdline.h b/client/common/cmdline.h index cb456ee7b..4c55cbb54 100644 --- a/client/common/cmdline.h +++ b/client/common/cmdline.h @@ -311,7 +311,7 @@ static const COMMAND_LINE_ARGUMENT_A global_cmd_args[] = { "Use multiple monitors" }, { "multitouch", COMMAND_LINE_VALUE_BOOL, NULL, BoolValueFalse, NULL, -1, NULL, "Redirect multitouch input" }, - { "multitransport", COMMAND_LINE_VALUE_BOOL, NULL, BoolValueFalse, NULL, -1, NULL, + { "multitransport", COMMAND_LINE_VALUE_BOOL, NULL, BoolValueTrue, NULL, -1, NULL, "Support multitransport protocol" }, { "nego", COMMAND_LINE_VALUE_BOOL, NULL, BoolValueTrue, NULL, -1, NULL, "protocol security negotiation" }, diff --git a/libfreerdp/core/gcc.c b/libfreerdp/core/gcc.c index 7e7cff090..e32322a7a 100644 --- a/libfreerdp/core/gcc.c +++ b/libfreerdp/core/gcc.c @@ -2071,6 +2071,16 @@ BOOL gcc_write_client_cluster_data(wStream* s, const rdpMcs* mcs) if (settings->RedirectSmartCards && settings->SmartcardLogon) flags |= REDIRECTED_SMARTCARD; + if (flags & REDIRECTION_SUPPORTED) + { + /* REDIRECTION_VERSION6 requires multitransport enabled. + * if we run without that use REDIRECTION_VERSION5 */ + if (freerdp_settings_get_bool(settings, FreeRDP_SupportMultitransport)) + flags |= (REDIRECTION_VERSION6 << 4); + else + flags |= (REDIRECTION_VERSION5 << 4); + } + WLog_VRB(TAG, "write ClusterInfoFlags=%s, RedirectedSessionId=0x%08" PRIx32, rdp_cluster_info_flags_to_string(flags, buffer, sizeof(buffer)), settings->RedirectedSessionId); diff --git a/libfreerdp/core/settings.c b/libfreerdp/core/settings.c index 968e8e93f..5ef455855 100644 --- a/libfreerdp/core/settings.c +++ b/libfreerdp/core/settings.c @@ -375,8 +375,7 @@ rdpSettings* freerdp_settings_new(DWORD flags) !freerdp_settings_set_bool(settings, FreeRDP_ServerMode, (flags & FREERDP_SETTINGS_SERVER_MODE) ? TRUE : FALSE) || !freerdp_settings_set_bool(settings, FreeRDP_WaitForOutputBufferFlush, TRUE) || - !freerdp_settings_set_uint32(settings, FreeRDP_ClusterInfoFlags, - REDIRECTION_SUPPORTED | (REDIRECTION_VERSION5 << 2)) || + !freerdp_settings_set_uint32(settings, FreeRDP_ClusterInfoFlags, REDIRECTION_SUPPORTED) || !freerdp_settings_set_uint32(settings, FreeRDP_DesktopWidth, 1024) || !freerdp_settings_set_uint32(settings, FreeRDP_DesktopHeight, 768) || !freerdp_settings_set_bool(settings, FreeRDP_Workarea, FALSE) || @@ -460,6 +459,13 @@ rdpSettings* freerdp_settings_new(DWORD flags) if (!freerdp_settings_set_pointer_len(settings, FreeRDP_MonitorIds, NULL, 0)) goto out_fail; + if (!freerdp_settings_set_uint32(settings, FreeRDP_MultitransportFlags, + (TRANSPORT_TYPE_UDP_FECR | TRANSPORT_TYPE_UDP_FECL | + TRANSPORT_TYPE_UDP_PREFERRED | SOFTSYNC_TCP_TO_UDP))) + goto out_fail; + if (!freerdp_settings_set_bool(settings, FreeRDP_SupportMultitransport, TRUE)) + goto out_fail; + if (!settings_get_computer_name(settings)) goto out_fail;