Hello Stefan,

Thank you for working on this. I like this a lot.

This makes it all very independent from the other code and we can pull it all 
in wherever it is needed.

I didn’t test this, but the changes look good to me!

-Michael

> On 18 Apr 2025, at 11:54, Stefan Schantl <[email protected]> wrote:
> 
> This reworked patchset contains a libwwwperl based flexible downloader
> function which easily can be used to download files or grab and display any
> web content.
> 
> The function now has been moved into an own perl library file
> (http-client-functions.pl) in order to cleanup the general functions
> library file. This should help to speed up the WUI by avoid to load to
> much and big perl modules.
> 
> The FetchPublicIp function has been reworked to use the new downloader
> and therefore moved to the http-client-functions file. As a result of
> this, the GetDyndnsRedIP function, which is using that function also
> has to be moved to the new library file and some existing CGI files needed
> to be adjusted to work properly again.
> 
> The following changes from the feedback of the previously sent patchset
> are also part of this patchset:
> 
> * Move the downloader into a seperate file.
> * Die in case no URL has been passed to the downloader.
> * Allow to specify the timeout time (default to 60sec if not set) insted of 
> hardcode it.
> 
> -Stefan
> 
> Stefan Schantl (7):
>  http-client-functions.pl: Introduce LWP-based flexible downloader
>    function.
>  http-client-functions.pl: Add FetchPublicIP function.
>  general-functions.pl: Drop FetchPublicIp function.
>  Move GetDyndnsRedIP from general-functions.pl to
>    http-client-functions.pl
>  ddns.cgi, wio.cgi: Use GetDyndnsRedIP from http-client-functions.pl
>    file
>  ids-functions.pl: Use new downloader function from
>    http-client-functions.pl
>  http-client-functions.pl: Allow to user define the timeout value.
> 
> config/cfgroot/general-functions.pl     |  46 ----
> config/cfgroot/http-client-functions.pl | 345 ++++++++++++++++++++++++
> config/cfgroot/ids-functions.pl         | 206 ++------------
> config/rootfiles/common/configroot      |   1 +
> html/cgi-bin/ddns.cgi                   |   3 +-
> html/cgi-bin/wio.cgi                    |   3 +-
> lfs/configroot                          |   1 +
> 7 files changed, 369 insertions(+), 236 deletions(-)
> create mode 100644 config/cfgroot/http-client-functions.pl
> 
> -- 
> 2.47.2
> 
> 


Reply via email to