Fixes #2982. The idea is to be able to create the socket externally and pass that...
authorNito Martinez <Nito@Qindel.ES>
Fri, 20 Nov 2015 01:44:35 +0000 (02:44 +0100)
committerNito Martinez <Nito@Qindel.ES>
Fri, 20 Nov 2015 01:44:35 +0000 (02:44 +0100)
The idea suggested is to use the following interface:

settings->ServerHostname = "|"
settings->ServerPort = SocketFD

libfreerdp/core/tcp.c

index 58dd96d..6496f75 100644 (file)
@@ -1047,6 +1047,7 @@ int freerdp_tcp_connect(rdpContext* context, rdpSettings* settings,
        UINT32 optval;
        socklen_t optlen;
        BOOL ipcSocket = FALSE;
+       BOOL useExternalDefinedSocket = FALSE;
 
        if (!hostname)
                return -1;
@@ -1054,12 +1055,18 @@ int freerdp_tcp_connect(rdpContext* context, rdpSettings* settings,
        if (hostname[0] == '/')
                ipcSocket = TRUE;
 
+       if (hostname[0] == '|')
+               useExternalDefinedSocket = TRUE;
+
        if (ipcSocket)
        {
                sockfd = freerdp_uds_connect(hostname);
 
                if (sockfd < 0)
                        return -1;
+       } else if (useExternalDefinedSocket)
+       {
+         sockfd = port;
        }
        else
        {