Skip to content

Commit

Permalink
Re-introduce native download on Darwin
Browse files Browse the repository at this point in the history
  • Loading branch information
LongDirtyAnimAlf committed Nov 5, 2018
1 parent 0a81b3c commit b888678
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fpcuputil.pas
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ TLogger = class(TObject)

TUseNativeDownLoader = Class(TBasicDownLoader)
private
{$ifdef Darwinn}
{$ifdef Darwin}
aFPHTTPClient:TNSHTTPSendAndReceive;
{$else}
aFPHTTPClient:TFPHTTPClient;
Expand Down Expand Up @@ -2871,7 +2871,7 @@ constructor TUseNativeDownLoader.Create;
begin
Inherited;
FMaxRetries:=MAXCONNECTIONRETRIES;
{$ifdef Darwinn}
{$ifdef Darwin}
// GitHub needs TLS 1.2 .... native FPC client does not support this (through OpenSSL)
// So, use client by Phil, a Lazarus forum member
// See: https://macpgmr.github.io/
Expand Down
7 changes: 7 additions & 0 deletions ns_url_request.pas
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ TCustomNSHTTPSendAndReceive = class(TObject)
procedure HTTPMethod(const AMethod, AURL: String; {%H-}Stream: TStream; const {%H-}AllowedResponseCodes: array of Integer);
function Get(const AURL: String): String;
procedure Get(const AURL: String; const LocalFileName: String);
procedure Get(const AURL: String; Stream: TStream);
end;

TNSHTTPSendAndReceive = Class(TCustomNSHTTPSendAndReceive)
Expand Down Expand Up @@ -311,4 +312,10 @@ procedure TCustomNSHTTPSendAndReceive.Get(const AURL: String; const LocalFileNam
end;
end;

procedure TCustomNSHTTPSendAndReceive.Get(const AURL: String; Stream: TStream);
begin
HTTPMethod('GET', AURL, Stream, [200]);
end;


end.

0 comments on commit b888678

Please sign in to comment.