Skip to content

Commit

Permalink
Code improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
viniciussanchez committed Aug 9, 2023
1 parent 811586a commit e486611
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/RESTRequest4D.Request.Client.pas
Original file line number Diff line number Diff line change
Expand Up @@ -437,10 +437,10 @@ function TRequestClient.SynchronizedEvents(const AValue: Boolean): IRequest;

function TRequestClient.Timeout: Integer;
begin
{$IF COMPILERVERSION <= 32.0}
Result := FRESTRequest.Timeout;
{$IF COMPILERVERSION <= 32}
Result := FRESTRequest.Timeout;
{$ELSE}
Result := FRESTRequest.ConnectTimeout;
Result := FRESTRequest.ConnectTimeout;
{$ENDIF}
end;

Expand Down Expand Up @@ -551,12 +551,11 @@ function TRequestClient.ResourceSuffix(const AResourceSuffix: string): IRequest;
function TRequestClient.Timeout(const ATimeout: Integer): IRequest;
begin
Result := Self;

{$IF COMPILERVERSION <= 32.0}
FRESTRequest.Timeout := ATimeout;
{$IF COMPILERVERSION <= 32}
FRESTRequest.Timeout := ATimeout;
{$ELSE}
FRESTRequest.ConnectTimeout := ATimeout;
FRESTRequest.ReadTimeout := ATimeout;
FRESTRequest.ConnectTimeout := ATimeout;
FRESTRequest.ReadTimeout := ATimeout;
{$ENDIF}
end;

Expand Down

0 comments on commit e486611

Please sign in to comment.