Menu

#53 synsock.Recv under MacOS

SynaSnap_36b
closed-fixed
nobody
None
5
2021-07-30
2021-07-14
No

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

Discussion

  • Geby

    Geby - 2021-07-30
    • status: open --> closed-fixed
     
  • Geby

    Geby - 2021-07-30

    We are supporting much more platforms... fixed in ssfpc.inc instead. Thanks.

     

Log in to post a comment.