Property FIOTimeout is only available with FPC3.1.1 To support older version the code is IDDef-ed. Patch by @varianus.

git-svn-id: trunk@53448 -
This commit is contained in:
balazs 2016-11-25 10:29:25 +00:00
parent e14d0595ba
commit 2f4b754c28

View File

@ -26,6 +26,14 @@ unit opkman_httpclient;
{$mode objfpc}{$H+}
{$IF FPC_VERSION = 3}
{$IF FPC_RELEASE > 0}
{$IF FPC_PATCH > 0}
{$DEFINE FPC311}
{$ENDIF}
{$ENDIF}
{$ENDIF}
interface
uses
@ -461,8 +469,10 @@ procedure TFPCustomHTTPClient.SetIOTimeout(AValue: Integer);
begin
if AValue=FIOTimeout then exit;
FIOTimeout:=AValue;
{ if Assigned(FSocket) then
FSocket.IOTimeout:=AValue;}
{$IFDEF FPC311}
if Assigned(FSocket) then
FSocket.IOTimeout:=AValue;
{$ENDIF}
end;
function TFPCustomHTTPClient.NoContentAllowed(ACode: Integer): Boolean;
@ -559,8 +569,10 @@ begin
G:=GetSocketHandler(UseSSL);
FSocket:=TInetSocket.Create(AHost,APort,G);
try
{ if FIOTimeout<>0 then
FSocket.IOTimeout:=FIOTimeout;}
{$IFDEF FPC311}
if FIOTimeout <> 0 then
FSocket.IOTimeout := FIOTimeout;
{$ENDIF}
FSocket.Connect;
except
FreeAndNil(FSocket);