Fixed redirection with session brokers.
authorArmin Novak <armin.novak@thincast.com>
Mon, 16 Apr 2018 14:45:00 +0000 (16:45 +0200)
committerArmin Novak <armin.novak@thincast.com>
Mon, 16 Apr 2018 14:46:48 +0000 (16:46 +0200)
* Only reconnect channels on redirect, if they have already been connected.
* Prefer TargetNetAddress over FQDN to connect.

libfreerdp/core/connection.c
libfreerdp/core/redirection.c

index 3b3b689..3a8cb6c 100644 (file)
@@ -371,18 +371,18 @@ BOOL rdp_client_redirect(rdpRdp* rdp)
        }
        else
        {
-               if (settings->RedirectionFlags & LB_TARGET_FQDN)
+        if (settings->RedirectionFlags & LB_TARGET_NET_ADDRESS)
                {
                        free(settings->ServerHostname);
-                       settings->ServerHostname = _strdup(settings->RedirectionTargetFQDN);
+                       settings->ServerHostname = _strdup(settings->TargetNetAddress);
 
                        if (!settings->ServerHostname)
                                return FALSE;
                }
-               else if (settings->RedirectionFlags & LB_TARGET_NET_ADDRESS)
+               else if (settings->RedirectionFlags & LB_TARGET_FQDN)
                {
                        free(settings->ServerHostname);
-                       settings->ServerHostname = _strdup(settings->TargetNetAddress);
+                       settings->ServerHostname = _strdup(settings->RedirectionTargetFQDN);
 
                        if (!settings->ServerHostname)
                                return FALSE;
index af030aa..ab96647 100644 (file)
@@ -156,14 +156,14 @@ int rdp_redirection_apply_settings(rdpRdp* rdp)
                if (!settings->RedirectionTargetFQDN)
                        return -1;
        }
-       else if (settings->RedirectionFlags & LB_TARGET_NET_ADDRESS)
+       if (settings->RedirectionFlags & LB_TARGET_NET_ADDRESS)
        {
                free(settings->TargetNetAddress);
                settings->TargetNetAddress = _strdup(redirection->TargetNetAddress);
                if (!settings->TargetNetAddress)
                        return -1;
        }
-       else if (settings->RedirectionFlags & LB_TARGET_NETBIOS_NAME)
+       if (settings->RedirectionFlags & LB_TARGET_NETBIOS_NAME)
        {
                free(settings->RedirectionTargetNetBiosName);
                settings->RedirectionTargetNetBiosName = _strdup(redirection->TargetNetBiosName);