mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-12 16:29:38 +02:00
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:
parent
e14d0595ba
commit
2f4b754c28
@ -26,6 +26,14 @@ unit opkman_httpclient;
|
|||||||
|
|
||||||
{$mode objfpc}{$H+}
|
{$mode objfpc}{$H+}
|
||||||
|
|
||||||
|
{$IF FPC_VERSION = 3}
|
||||||
|
{$IF FPC_RELEASE > 0}
|
||||||
|
{$IF FPC_PATCH > 0}
|
||||||
|
{$DEFINE FPC311}
|
||||||
|
{$ENDIF}
|
||||||
|
{$ENDIF}
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
interface
|
interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
@ -461,8 +469,10 @@ procedure TFPCustomHTTPClient.SetIOTimeout(AValue: Integer);
|
|||||||
begin
|
begin
|
||||||
if AValue=FIOTimeout then exit;
|
if AValue=FIOTimeout then exit;
|
||||||
FIOTimeout:=AValue;
|
FIOTimeout:=AValue;
|
||||||
{ if Assigned(FSocket) then
|
{$IFDEF FPC311}
|
||||||
FSocket.IOTimeout:=AValue;}
|
if Assigned(FSocket) then
|
||||||
|
FSocket.IOTimeout:=AValue;
|
||||||
|
{$ENDIF}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TFPCustomHTTPClient.NoContentAllowed(ACode: Integer): Boolean;
|
function TFPCustomHTTPClient.NoContentAllowed(ACode: Integer): Boolean;
|
||||||
@ -559,8 +569,10 @@ begin
|
|||||||
G:=GetSocketHandler(UseSSL);
|
G:=GetSocketHandler(UseSSL);
|
||||||
FSocket:=TInetSocket.Create(AHost,APort,G);
|
FSocket:=TInetSocket.Create(AHost,APort,G);
|
||||||
try
|
try
|
||||||
{ if FIOTimeout<>0 then
|
{$IFDEF FPC311}
|
||||||
FSocket.IOTimeout:=FIOTimeout;}
|
if FIOTimeout <> 0 then
|
||||||
|
FSocket.IOTimeout := FIOTimeout;
|
||||||
|
{$ENDIF}
|
||||||
FSocket.Connect;
|
FSocket.Connect;
|
||||||
except
|
except
|
||||||
FreeAndNil(FSocket);
|
FreeAndNil(FSocket);
|
||||||
|
Loading…
Reference in New Issue
Block a user