Browse Source

--- Merging r17854 into '.':
U packages/fcl-web/src/base/custfcgi.pp

# revisions: 17854
------------------------------------------------------------------------
r17854 | marco | 2011-06-28 13:31:49 +0200 (Tue, 28 Jun 2011) | 3 lines
Changed paths:
M /trunk/packages/fcl-web/src/base/custfcgi.pp

* changed windows pipe implementation to win32/win64 only. Wince status now unsure, but at least compiling.
Mantis #17646

------------------------------------------------------------------------

git-svn-id: branches/fixes_2_4@17855 -

marco 14 years ago
parent
commit
f37e5324ff
1 changed files with 10 additions and 4 deletions
  1. 10 4
      packages/fcl-web/src/base/custfcgi.pp

+ 10 - 4
packages/fcl-web/src/base/custfcgi.pp

@@ -20,6 +20,10 @@ unit custfcgi;
 
 Interface
 
+{$if defined(win32) or defined(win64)}
+{$define windowspipe}
+{$ifend}
+
 uses
   Classes,SysUtils, httpdefs, 
 {$ifdef unix}
@@ -101,7 +105,7 @@ Type
     FAddress: string;
     FTimeOut,
     FPort: integer;
-{$ifdef windows}
+{$ifdef windowspipe}
     FIsWinPipe: Boolean;
 {$endif}
     function AcceptConnection: Integer;
@@ -492,7 +496,7 @@ procedure TFCgiHandler.CloseConnection;
 Var
   i : Integer;
 begin
-{$ifdef windows}
+{$ifdef windowspipe}
   if FIsWinPipe then
     begin
     if not FlushFileBuffers(FHandle) then
@@ -714,7 +718,7 @@ end;
 
 function TFCgiHandler.DoFastCGIRead(AHandle: THandle; var ABuf; ACount: Integer): Integer;
 begin
-{$ifdef windows}
+{$ifdef windowspipe}
   if FIsWinPipe then
     Result:=FileRead(FHandle,ABuf,ACount)
   else
@@ -725,7 +729,7 @@ end;
 function TFCgiHandler.DoFastCGIWrite(AHandle: THandle; const ABuf;
   ACount: Integer): Integer;
 begin
-  {$ifdef windows}
+  {$ifdef windowspipe}
   if FIsWinPipe then
     Result := FileWrite(AHandle, ABuf, ACount)
   else
@@ -789,6 +793,7 @@ begin
 {$else}
   if Not fIsWinPipe then
     Result:=fpaccept(Socket,psockaddr(@FIAddress),@FAddressLength);
+  {$ifdef windowspipe}
   If FIsWinPipe or ((Result<0) and (socketerror=10038)) then
     begin
     B:=ConnectNamedPipe(Socket,Nil);
@@ -804,6 +809,7 @@ begin
        FIsWinPipe:=True;
        end;
     end;
+   {$endif}
 {$endif}
 end;