From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4ZgR5D2D82z332J for ; Sun, 20 Apr 2025 11:25:52 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) client-signature RSA-PSS (4096 bits)) (Client CN "mail01.haj.ipfire.org", Issuer "R10" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4ZgR585R5xz2xfT for ; Sun, 20 Apr 2025 11:25:48 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4ZgR581MFczM7; Sun, 20 Apr 2025 11:25:48 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1745148348; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gB34m0Z9pOMQDNNfF3jnu6X6bTyCo6YSlS5Rkr+T/vo=; b=NN/HYHMYyyee8umKrs8dr+gf+tJW4X7nB2j8EYGBzcdNxmpYg7Omr8sRnMjyggBpFZpN/T N4+RVmejjWr28rAg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1745148348; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gB34m0Z9pOMQDNNfF3jnu6X6bTyCo6YSlS5Rkr+T/vo=; b=Umix9hN2LunjmcV9DN+1Pvy4Dr2w18/0sxLWLAeI0WS0bOpPSe1PDFpaccqSVpi2OwK19r A7bz12R9JjU3WE3KdMs2mQYwJlPPft2ahx4LmSrP5TLHVkRpgnWhcHEkM22TyKKEASk6cx dVKhsaY5ZFhv+wFNr2Vy7eimkUufqkMgLFUJEcP3La51LqnfLOhWExPK7S1RjrgXbZZ7lv AsB7dBcMX16LvqUe+ZFkeMM4DuRaJNK1SaroH+J40nVsOYefv198irCowWyp7iUcK3qCnl bpTK3bbAK08chanX94qqqrbVR+KKxrsq90hE396b982PG2TNCo3ajDP8G4w4NQ== Content-Type: text/plain; charset=utf-8 Precedence: list List-Id: List-Subscribe: , List-Unsubscribe: , List-Post: List-Help: Sender: Mail-Followup-To: Mime-Version: 1.0 Subject: Re: [PATCHv2 0/7] Introduce perl LWP-based flexible downloader function From: Michael Tremer In-Reply-To: <20250418110741.7756-1-stefan.schantl@ipfire.org> Date: Sun, 20 Apr 2025 12:25:47 +0100 Cc: development@lists.ipfire.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <20250418110741.7756-1-stefan.schantl@ipfire.org> To: Stefan Schantl 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=E2=80=99t test this, but the changes look good to me! -Michael > On 18 Apr 2025, at 11:54, Stefan Schantl = wrote: >=20 > 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. >=20 > 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. >=20 > 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. >=20 > The following changes from the feedback of the previously sent = patchset > are also part of this patchset: >=20 > * 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. >=20 > -Stefan >=20 > 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. >=20 > 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 >=20 > --=20 > 2.47.2 >=20 >=20