瀏覽代碼

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

git-svn-id: trunk@17854 -

marco 14 年之前
父節點
當前提交
d9a8a029c9
共有 1 個文件被更改,包括 10 次插入4 次删除
  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
@@ -715,7 +719,7 @@ end;
 
 function TFCgiHandler.DoFastCGIRead(AHandle: THandle; var ABuf; ACount: Integer): Integer;
 begin
-{$ifdef windows}
+{$ifdef windowspipe}
   if FIsWinPipe then
     Result:=FileRead(AHandle,ABuf,ACount)
   else
@@ -726,7 +730,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
@@ -790,6 +794,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);
@@ -805,6 +810,7 @@ begin
        FIsWinPipe:=True;
        end;
     end;
+   {$endif}
 {$endif}
 end;