From f1b299c3e26d551ebadd9f5d3fe322920a476107 Mon Sep 17 00:00:00 2001 From: David Fort Date: Mon, 26 Aug 2024 19:53:49 +0200 Subject: [PATCH] core: relax check in freerdp_peer_new Not all socket kinds have the TCP_NODELAY option (especially local UNIX sockets), so don't make the setsockopt fatal. --- libfreerdp/core/peer.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libfreerdp/core/peer.c b/libfreerdp/core/peer.c index c083a87ec..7e41b1809 100644 --- a/libfreerdp/core/peer.c +++ b/libfreerdp/core/peer.c @@ -1458,7 +1458,11 @@ freerdp_peer* freerdp_peer_new(int sockfd) if (sockfd >= 0) { if (setsockopt(sockfd, IPPROTO_TCP, TCP_NODELAY, (void*)&option_value, option_len) < 0) - goto fail; + { + /* local unix sockets don't have the TCP_NODELAY implemented, so don't make this + * error fatal */ + WLog_DBG(TAG, "can't set TCP_NODELAY, continuing anyway"); + } } if (client) @@ -1490,10 +1494,6 @@ freerdp_peer* freerdp_peer_new(int sockfd) } return client; - -fail: - freerdp_peer_free(client); - return NULL; } void freerdp_peer_free(freerdp_peer* client)