mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-15 00:44:19 +09:00
Fixes #2982. The idea is to be able to create the socket externally and pass that socket FD to FreeRDP so that it can be used there.
The idea suggested is to use the following interface: settings->ServerHostname = "|" settings->ServerPort = SocketFD
This commit is contained in:
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user