Menu

#12 Using lazautoupdate_httpclient.TfpCustomHTTPClient versus fphttpclient.TfpCustomHTTPClient

Release
open
None
2021-09-10
2021-09-09
Eric69
No

( Cf. my "noise", here: https://forum.lazarus.freepascal.org/index.php/topic,25444.msg417730.html#msg417730 )

Several changes, in order to know when to use fphttpclient.TfpCustomHTTPClient when the patch {$DEFINE FPC311} has been applied:
· in the file lazautoupdate_httpclient.pas, the patch {$DEFINE FPC311} is applied (line 472)...:

procedure TFPCustomHTTPClient.SetIOTimeout(AValue: Integer);
begin
  if AValue=FIOTimeout then exit;
  FIOTimeout:=AValue;
  {$IFDEF FPC311}
   if Assigned(FSocket) then
     FSocket.IOTimeout:=AValue;
  {$ENDIF}
end;

· ...this same patch is applied in fphttpclient.TfpCustomHTTPClient ( in the release fpc_3.0.2, Cf. https://gitlab.com/freepascal.org/fpc/source/-/commit/2ab345807484e219b3b5372d867617dab2af4f99 ).

➔ So, I propose this correction, in order to assist in guiding when to use the right component, doing this:
· open the file lazupdate.lpk;
· remove the file lazautoupdate_httpclient from the package (it should - now - be used only inside a conditional statement);
· open the file ulazautoupdate.pas in order to replace:

uses 
...\...
lazautoupdate_httpclient 

with

{$IF (FPC_FULLVERSION>=30000) AND (FPC_FULLVERSION<30002)}
  lazautoupdate_httpclient {original lazautoupdate_httpclient.FPC311 should be DEFINEd and applied, here},
{$ELSEIF FPC_FULLVERSION>=30002}
  fphttpclient,
{$ENDIF}

· open the file open_ssl.pas in order to replace (same thing as above):

uses 
...\...
lazautoupdate_httpclient 

with

{$IF (FPC_FULLVERSION>=30000) AND (FPC_FULLVERSION<30002)}
  lazautoupdate_httpclient {original lazautoupdate_httpclient.FPC311 should be DEFINEd and applied, here},
{$ELSEIF FPC_FULLVERSION>=30002}
  fphttpclient,
{$ENDIF}

Regards.

Discussion

  • Eric69

    Eric69 - 2021-09-09

    · Oops: it should not be forgotten to increment the version of the lazupdate.lpk (should be 0.3.9).

     
  • Eric69

    Eric69 - 2021-09-10

    · Re-oops: it should not be forgotten to warn the Lazarus forum ( https://forum.lazarus.freepascal.org/index.php/topic,34297.0.html ), in order to update the [OPM] maintainer so that he'll download the latest version.

     

    Last edit: Eric69 2021-09-10

Log in to post a comment.