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 4ZfC1B4rqFz337q for ; Fri, 18 Apr 2025 11:18:06 +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 4ZfC162PvRz339f for ; Fri, 18 Apr 2025 11:18:02 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4ZfC142KKwz3G1; Fri, 18 Apr 2025 11:18:00 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1744975080; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=X2Mc5M1PkG8Fedb71c0+i82C23c9AvfA0ka8iKobqH8=; b=7PqgCi8NemDUxoDsezKCC+y6sQkeuMXLAkldGomOWpmNA2MiOAvF7ZDK5zunsGMeOceIor 1Owbyc7HSyZfmjAA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1744975080; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=X2Mc5M1PkG8Fedb71c0+i82C23c9AvfA0ka8iKobqH8=; b=T+2bCSuNFnipgiE082cQ9d/ORykxmXzrzw5kjkPaKaNI/oRJ0sf/QnPP44aDXmuwGfdt2h dEEiPxSIEeRrQBTlusxc8tb+xJWViFLMnYksELj8eFK/jHx1QG6aLJUWUxhiPGHFaSDkEi 9/tHP0JgT1zKZFXd82WJ+loLoKKXCyYCOXL2EG9oHL3uTCppN4AK71zkNuxcquJl2UUnHW swdepjC9W00o/2J9lneBCCGZU89h9hOjUiMkPqJAjhJMJ+W7eHtsX+K7530ZPHd2GRkhQS xOWPBSKpaVQ5Ft5lxjx8mFo9CB7yEISbVHdZvE9vZ2LXpCu1x0k5Gdskkd2H0g== From: Stefan Schantl To: development@lists.ipfire.org Cc: Stefan Schantl Subject: [PATCHv2 7/7] http-client-functions.pl: Allow to user define the timeout value. Date: Fri, 18 Apr 2025 12:54:46 +0200 Message-ID: <20250418110741.7756-8-stefan.schantl@ipfire.org> In-Reply-To: <20250418110741.7756-1-stefan.schantl@ipfire.org> References: <20250418110741.7756-1-stefan.schantl@ipfire.org> Precedence: list List-Id: List-Subscribe: , List-Unsubscribe: , List-Post: List-Help: Sender: Mail-Followup-To: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit This allows to specify the the timeout value. Defaults to to 60 seconds if not set. Signed-off-by: Stefan Schantl --- config/cfgroot/http-client-functions.pl | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/config/cfgroot/http-client-functions.pl b/config/cfgroot/http-client-functions.pl index f1f7de309..c9484c575 100644 --- a/config/cfgroot/http-client-functions.pl +++ b/config/cfgroot/http-client-functions.pl @@ -89,6 +89,10 @@ sub downloader (%) { $etagprefix = $args{"ETAGPREFIX"} if (exists($args{"ETAGPREFIX"})); my $max_size = $args{"MAXSIZE"} if (exists($args{"MAXSIZE"})); + # Timeout defaults to 60 Seconds if not set. + my $timeout = 60; + $timeout = $args{"TIMEOUT"} if (exists($args{"TIMEOUT"})); + # Abort with error "no url", if no URL has been given. die "downloader: No URL has been given." unless ($url); @@ -110,8 +114,9 @@ sub downloader (%) { }, ); - # Set timeout to 10 seconds. - $ua->timeout(10); + # Set the timeout to the configured value. + # Defaults to 60 seconds if not set. + $ua->timeout($timeout); # Assign maximum download size if set. $ua->max_size($max_size) if ($max_size); -- 2.47.2