mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-14 07:09:23 +02:00
* fix for OS X not having MSG_NOSIGNAL.
git-svn-id: trunk@13279 -
This commit is contained in:
parent
ef0438ec7e
commit
5f13f1873f
@ -87,6 +87,15 @@ uses
|
|||||||
{$endif}
|
{$endif}
|
||||||
Sockets;
|
Sockets;
|
||||||
|
|
||||||
|
{$undef nosignal}
|
||||||
|
|
||||||
|
{$if defined(FreeBSD) or defined(Linux)}
|
||||||
|
{$define nosignal}
|
||||||
|
{$ifend}
|
||||||
|
|
||||||
|
Const
|
||||||
|
NoSignalAttr = {$ifdef nosignal} MSG_NOSIGNAL{$else}0{$endif};
|
||||||
|
|
||||||
{ TFCGIHTTPRequest }
|
{ TFCGIHTTPRequest }
|
||||||
|
|
||||||
procedure TFCGIRequest.ReadContent;
|
procedure TFCGIRequest.ReadContent;
|
||||||
@ -243,7 +252,7 @@ var BytesToWrite : word;
|
|||||||
BytesWritten : Integer;
|
BytesWritten : Integer;
|
||||||
begin
|
begin
|
||||||
BytesToWrite := BEtoN(ARecord^.contentLength) + ARecord^.paddingLength+sizeof(FCGI_Header);
|
BytesToWrite := BEtoN(ARecord^.contentLength) + ARecord^.paddingLength+sizeof(FCGI_Header);
|
||||||
BytesWritten := sockets.fpsend(TFCGIRequest(Request).Handle, ARecord, BytesToWrite, {$ifdef unix} MSG_NOSIGNAL{$else}0{$endif});
|
BytesWritten := sockets.fpsend(TFCGIRequest(Request).Handle, ARecord, BytesToWrite, NoSignalAttr);
|
||||||
Assert(BytesWritten=BytesToWrite);
|
Assert(BytesWritten=BytesToWrite);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -359,7 +368,7 @@ var Header : FCGI_Header;
|
|||||||
result := False;
|
result := False;
|
||||||
if ByteAmount>0 then
|
if ByteAmount>0 then
|
||||||
begin
|
begin
|
||||||
BytesRead := sockets.fpRecv(FHandle, ReadBuf, ByteAmount, {$ifdef unix} MSG_NOSIGNAL{$else}0{$endif});
|
BytesRead := sockets.fpRecv(FHandle, ReadBuf, ByteAmount, NoSignalAttr);
|
||||||
if BytesRead<>ByteAmount then
|
if BytesRead<>ByteAmount then
|
||||||
begin
|
begin
|
||||||
// SendDebug('FCGIRecord incomplete');
|
// SendDebug('FCGIRecord incomplete');
|
||||||
|
Loading…
Reference in New Issue
Block a user