From 09099050cb2448a6b40ac3b17eab59f47c57d6a2 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Mon, 10 Apr 2017 00:13:38 -0700 Subject: [PATCH] GUACAMOLE-40: Set RD gateway and load balancing settings for FreeRDP where applicable. --- src/protocols/rdp/rdp_settings.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/protocols/rdp/rdp_settings.c b/src/protocols/rdp/rdp_settings.c index 1ec34b9f..998f0a21 100644 --- a/src/protocols/rdp/rdp_settings.c +++ b/src/protocols/rdp/rdp_settings.c @@ -1249,6 +1249,34 @@ void guac_rdp_push_settings(guac_rdp_settings* guac_settings, freerdp* rdp) { } #endif +#ifdef HAVE_FREERDP_GATEWAY_SUPPORT + /* Enable use of RD gateway if a gateway hostname is provided */ + if (guac_settings->gateway_hostname != NULL) { + + /* Enable RD gateway */ + rdp_settings->GatewayEnabled = TRUE; + + /* RD gateway connection details */ + rdp_settings->GatewayHostname = guac_rdp_strdup(guac_settings->gateway_hostname); + rdp_settings->GatewayPort = guac_settings->gateway_port; + + /* RD gateway credentials */ + rdp_settings->GatewayUseSameCredentials = FALSE; + rdp_settings->GatewayDomain = guac_rdp_strdup(guac_settings->gateway_domain); + rdp_settings->GatewayUsername = guac_rdp_strdup(guac_settings->gateway_username); + rdp_settings->GatewayPassword = guac_rdp_strdup(guac_settings->gateway_password); + + } +#endif + +#ifdef HAVE_FREERDP_LOAD_BALANCER_SUPPORT + /* Store load balance info (and calculate length) if provided */ + if (guac_settings->load_balance_info != NULL) { + rdp_settings->LoadBalanceInfo = (BYTE*) guac_rdp_strdup(guac_settings->load_balance_info); + rdp_settings->LoadBalanceInfoLength = strlen(guac_settings->load_balance_info); + } +#endif + /* Order support */ #ifdef LEGACY_RDPSETTINGS bitmap_cache = rdp_settings->bitmap_cache;