From af858e8f2a5e5fdba804109b44ef339547a700ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Moreau?= Date: Tue, 23 Sep 2014 18:19:05 -0400 Subject: [PATCH] shadow: disable RemoteFX if connection type is not LAN --- libfreerdp/core/gcc.c | 8 +++++++- server/shadow/shadow_client.c | 5 +++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/libfreerdp/core/gcc.c b/libfreerdp/core/gcc.c index dbe22b391..95c865009 100644 --- a/libfreerdp/core/gcc.c +++ b/libfreerdp/core/gcc.c @@ -558,6 +558,7 @@ BOOL gcc_read_client_core_data(wStream* s, rdpMcs* mcs, UINT16 blockLength) { char* str = NULL; UINT32 version; + BYTE connectionType = 0; UINT32 clientColorDepth; UINT16 colorDepth = 0; UINT16 postBeta2ColorDepth = 0; @@ -653,7 +654,7 @@ BOOL gcc_read_client_core_data(wStream* s, rdpMcs* mcs, UINT16 blockLength) if (blockLength < 1) break; - Stream_Read_UINT8(s, settings->PerformanceFlags); /* connectionType (1 byte) */ + Stream_Read_UINT8(s, connectionType); /* connectionType (1 byte) */ blockLength -= 1; if (blockLength < 1) @@ -759,6 +760,11 @@ BOOL gcc_read_client_core_data(wStream* s, rdpMcs* mcs, UINT16 blockLength) if (settings->SupportDynamicTimeZone) settings->SupportDynamicTimeZone = (earlyCapabilityFlags & RNS_UD_CS_SUPPORT_DYNAMIC_TIME_ZONE) ? TRUE : FALSE; + if (!(earlyCapabilityFlags & RNS_UD_CS_VALID_CONNECTION_TYPE)) + connectionType = 0; + + settings->ConnectionType = connectionType; + return TRUE; } diff --git a/server/shadow/shadow_client.c b/server/shadow/shadow_client.c index fb9dae6e9..b44fb500b 100644 --- a/server/shadow/shadow_client.c +++ b/server/shadow/shadow_client.c @@ -166,6 +166,11 @@ BOOL shadow_client_post_connect(freerdp_peer* peer) settings->RemoteFxCodec = FALSE; } + if (settings->ConnectionType != CONNECTION_TYPE_LAN) + { + settings->RemoteFxCodec = FALSE; + } + WLog_ERR(TAG, "Client from %s is activated (%dx%d@%d)", peer->hostname, settings->DesktopWidth, settings->DesktopHeight, settings->ColorDepth);