Disable setting socket options for preexisting socket like: keepalive and tcp_nodelay, these should be set extenally if needed. Do not close the socket if the clientaddress could not be set
This commit is contained in:
parent
428cbd802d
commit
89d8a68f4a
@ -1150,7 +1150,8 @@ int freerdp_tcp_connect(rdpContext* context, rdpSettings* settings,
|
|||||||
settings->ClientAddress = freerdp_tcp_get_ip_address(sockfd);
|
settings->ClientAddress = freerdp_tcp_get_ip_address(sockfd);
|
||||||
if (!settings->ClientAddress)
|
if (!settings->ClientAddress)
|
||||||
{
|
{
|
||||||
close(sockfd);
|
if (!useExternalDefinedSocket)
|
||||||
|
close(sockfd);
|
||||||
WLog_ERR(TAG, "Couldn't get socket ip address");
|
WLog_ERR(TAG, "Couldn't get socket ip address");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -1158,7 +1159,7 @@ int freerdp_tcp_connect(rdpContext* context, rdpSettings* settings,
|
|||||||
optval = 1;
|
optval = 1;
|
||||||
optlen = sizeof(optval);
|
optlen = sizeof(optval);
|
||||||
|
|
||||||
if (!ipcSocket)
|
if (!ipcSocket && !useExternalDefinedSocket)
|
||||||
{
|
{
|
||||||
if (setsockopt(sockfd, IPPROTO_TCP, TCP_NODELAY, (void*) &optval, optlen) < 0)
|
if (setsockopt(sockfd, IPPROTO_TCP, TCP_NODELAY, (void*) &optval, optlen) < 0)
|
||||||
WLog_ERR(TAG, "unable to set TCP_NODELAY");
|
WLog_ERR(TAG, "unable to set TCP_NODELAY");
|
||||||
@ -1181,7 +1182,7 @@ int freerdp_tcp_connect(rdpContext* context, rdpSettings* settings,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ipcSocket)
|
if (!ipcSocket && !useExternalDefinedSocket)
|
||||||
{
|
{
|
||||||
if (!freerdp_tcp_set_keep_alive_mode(sockfd))
|
if (!freerdp_tcp_set_keep_alive_mode(sockfd))
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user