diff --git a/source/shared_lib/sources/feathery_ftp/ftpTargetPosix.c b/source/shared_lib/sources/feathery_ftp/ftpTargetPosix.c index ad30dd43c..5b27ee32a 100644 --- a/source/shared_lib/sources/feathery_ftp/ftpTargetPosix.c +++ b/source/shared_lib/sources/feathery_ftp/ftpTargetPosix.c @@ -189,7 +189,12 @@ int ftpSend(socket_t s, const void *data, int len) do { - currLen = send(s, data, len, 0); +#ifdef __APPLE__ + currLen = send(s, data, len, SO_NOSIGPIPE); +#else + currLen = send(s, data, len, MSG_NOSIGNAL); +#endif + if(currLen >= 0) { len -= currLen; diff --git a/source/shared_lib/sources/feathery_ftp/ftpTargetWin32.c b/source/shared_lib/sources/feathery_ftp/ftpTargetWin32.c index 49668482e..a9626097c 100644 --- a/source/shared_lib/sources/feathery_ftp/ftpTargetWin32.c +++ b/source/shared_lib/sources/feathery_ftp/ftpTargetWin32.c @@ -31,6 +31,8 @@ #pragma comment(lib, "ws2_32") #pragma comment(lib, "MSWSOCK") + +#define MSG_NOSIGNAL 0 ip_t ownIp; @@ -218,8 +220,13 @@ int ftpSend(socket_t s, const void *data, int len) int currLen = 0; do - { - currLen = send((SOCKET)s, data, len, 0); + { +#ifdef __APPLE__ + currLen = send((SOCKET)s, data, len, SO_NOSIGPIPE); +#else + currLen = send((SOCKET)s, data, len, MSG_NOSIGNAL); +#endif + if(currLen >= 0) { len -= currLen;