Hi all
I've found a bug when receiving buffer under MacOS.
TBlockSocket.RecvBuffer contains synsock.Recv call to read buffer in a blocking way.
However, due invalid constant MSG_NOSIGNAL under MacOS it behaves as MSG_PEEK.
I believe MSG_NOSIGNAL is not necessary both for MacOS and for Linux.
So it should be dropped.
Tested under FPC 3.3.1, Linux x64 and MacOS Catalina.
diff --git a/synapse40.1/blcksock.pas b/synapse40.1/blcksock.pas
index 06fef7a..1ed34b7 100644
--- a/src/synapse40.1/blcksock.pas
+++ b/src/synapse40.1/blcksock.pas
@@ -2205,8 +2205,7 @@ begin
if TestStopFlag then
Exit;
LimitBandwidth(Length, FMaxRecvBandwidth, FNextRecv);
-// Result := synsock.Recv(FSocket, Buffer^, Length, MSG_NOSIGNAL);
- Result := synsock.Recv(FSocket, Buffer, Length, MSG_NOSIGNAL);
+ Result := synsock.Recv(FSocket, Buffer, Length, 0); // Remove MSG_NOSIGNAL. Breaks MacOS and it's not useful
if Result = 0 then
FLastError := WSAECONNRESET
else
BR,
Denis
We are supporting much more platforms... fixed in ssfpc.inc instead. Thanks.