From patchwork Thu May 30 08:20:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dominique Martinet X-Patchwork-Id: 1941568 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.a=rsa-sha256 header.s=20230601 header.b=DPDNHg3D; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=googlegroups.com (client-ip=2607:f8b0:4864:20::13a; helo=mail-il1-x13a.google.com; envelope-from=swupdate+bncbcwivbv7sugrbrxn4czamgqegxw7ipy@googlegroups.com; receiver=patchwork.ozlabs.org) Received: from mail-il1-x13a.google.com (mail-il1-x13a.google.com [IPv6:2607:f8b0:4864:20::13a]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VqfMK2BTNz20fB for ; Thu, 30 May 2024 18:20:28 +1000 (AEST) Received: by mail-il1-x13a.google.com with SMTP id e9e14a558f8ab-36da6da1d98sf6152715ab.2 for ; Thu, 30 May 2024 01:20:28 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717057223; cv=pass; d=google.com; s=arc-20160816; b=dOpR5V7GVwFor5WbUKUlmVrP4Bzu4cdY3VuA/7UyEnXJ3++RDmPsCec1O/Akz/MHQg 8/SXagHrHsh0vQPAT+HGGV2ePEtlqOG6NUHir6WDgnzWFnEWs9LDdrQ5xRsO4zOj4Lrw R8FErkFfX1aVkS5M+g6aaYSJdnukszkIZyihk+hD1AA/lYPKFKXZNaThmQ6S5zLjTmMk tJbg0DqaOQwLi/Q88jQsG6HzGbnvIyhSm5JTaAmjRmxby5qioT1EzV5lwO26bMgYb6p9 qaRLXOcE9kTW8veFloRMNZfO+mZxrkNDUuYt8OQR9OqXhcKJMlcrPE2+S/cisA8bnc8e PslQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:dkim-signature; bh=iWLsaba7SVRcBRHOEG+Zxf1+7+WAMDWejPM9WhrMjW4=; fh=a6sQ9xcWS+rY/6RGCYWRsfjrBQnrCoy6rjum4hKf8RQ=; b=xX18Ua8MoAcoW2eOV5BsOMUTwaGzmQOUZruA+T/gHca9PvhAugKKNhAKvSwu8nvbjl yM05d6J3eCUBu+WUJMVxZvq08GUWWCsvnqpVF8tt6FMu1ydNzU5j26qvZ26qZuvqxODc iNgyy6yBikHWzhFawZX50XwHAGMwuu4GLaBZdo1iqoWfGLqATT9silQpkt8Tzr/472RE cpchjjtsvPFBsElqoYNvdNaE1SdZKZhmaSk7Kyjv0TpC+fw1/A6Y+BJCUMK+BRFxALXt FNRs5bMnHL1P5rLNPrcTBa7trIDW4s30Cu/kJq4I8ZSkbIUYwL3USdIW3VDAXQaG3G0z xvGw==; darn=patchwork.ozlabs.org ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@atmark-techno.com header.s=gw2_bookworm header.b=luQ94ccy; dkim=pass header.i=@atmark-techno.com header.s=google header.b=DXvx1HeD; spf=pass (google.com: domain of dominique.martinet@atmark-techno.com designates 35.74.137.57 as permitted sender) smtp.mailfrom=dominique.martinet@atmark-techno.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=atmark-techno.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20230601; t=1717057223; x=1717662023; darn=patchwork.ozlabs.org; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:sender:from:to:cc:subject:date:message-id :reply-to; bh=iWLsaba7SVRcBRHOEG+Zxf1+7+WAMDWejPM9WhrMjW4=; b=DPDNHg3DTt9NHC2wRgZYfoQS3+bLpIQYv0hyK+/pxuMPPbvXAe8ndjLUYiE5n604GE tIc6mAJf/5DjQUM1CgEqxBP6E/CjEeogB+Lx9GYGSUfN/F98wCqJ64EhXIeSaWX6Mynh vJati2BUGRAx+ggaJERxGHEYJXvOseY3iSX6Sm8IgZZxpjPFru8Fg0jNrNChtRK0JZut UfEmKMeebvc6hj6HwZVpWQiH8pQKZNx58db/FJfy46DtzaDqoEUo/7C5Wl4tXDzw/zSt IyCZgqRDNiL13oLW8NCgUbTiTdYMOnjw+VtSyb8RD255jEk4By791ZVeXu6/MjEKKJxJ b3oQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717057223; x=1717662023; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :x-beenthere:x-gm-message-state:sender:from:to:cc:subject:date :message-id:reply-to; bh=iWLsaba7SVRcBRHOEG+Zxf1+7+WAMDWejPM9WhrMjW4=; b=CT2ry3MehKXsLA+qytFbzPvW9jT/fwYhuvFt7It0jUo1ravKdvRCEHggd4XVbmkqHm pju7lxQKgXkAANjzDqogU0354e/gtxYUItGundGcSf3n5TwgHypkhABnHzgmnmIyCFQ8 4RkuUpF1kX85F75ZCm5Mlrak8PUWS7vl3k8KpCUMjXkdH1ZN2eV+7eAdCZjDOH9xmMDL snmfNfkrDo8vf0YCuXFu0piWac+oUZv75PM7yjl1beXAAuyLEJ+T9/fUnvM7+i+1Dpoq 8k5ykLo8vt17vJkSaM6iqBve3IV8FICHix8CcxWt3zBm+N5DZp9mrfLc8Qqcpo3RinhU Vg6w== Sender: swupdate@googlegroups.com X-Forwarded-Encrypted: i=2; AJvYcCXwplejzUljM+rrHqELftHGVyvNEc+Xwz4FAhBTZINpLwvk0g6fKI/eOstc1QwKStJXb59+1dZt851N7RvzqVsMYRsQiK8cgH+sobjzVg== X-Gm-Message-State: AOJu0YzRYXGBZeFvOkiM3ZddCpIGVbgbGzsngReeH1J0et2KcN1BVb4p 1MG5siRuX0PTIpTHDg1jkepzIh4IPufMEi/+dY2MPxyluCF99n7u X-Google-Smtp-Source: AGHT+IHUTrqzC3orAPuXitYSWLQqh5gX2Y2TQmKcNEc6QksgX4rAEc3ZO2+W1gdfPqbPyU/z+KvKjA== X-Received: by 2002:a05:6e02:1569:b0:36c:73cc:710f with SMTP id e9e14a558f8ab-3747dfa9526mr14432085ab.3.1717057223577; Thu, 30 May 2024 01:20:23 -0700 (PDT) X-BeenThere: swupdate@googlegroups.com Received: by 2002:a05:6e02:1688:b0:36b:300b:3a62 with SMTP id e9e14a558f8ab-3747ab10240ls4959395ab.0.-pod-prod-02-us; Thu, 30 May 2024 01:20:22 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVR/8V5AEFqeHK2ZxvvaH7jFUVMpXK7XuPNN1WE19IqaoE3kbtF8TH1WkiQy7EYUEBWLo5uP/sDNEoEPU0Srei96YDSdpcxP1hB X-Received: by 2002:a05:6602:148d:b0:7d6:aa:8a54 with SMTP id ca18e2360f4ac-7eaf5d34245mr157854839f.11.1717057222237; Thu, 30 May 2024 01:20:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1717057222; cv=none; d=google.com; s=arc-20160816; b=o/q5+8PlLaeHHrEWufx0ewYC1I8QIyMF2PafjiyaNz7cwyojP8BMz+XauJBXtV9CFh yN0ZlE9/z3QqhN+wpBEP71XariYWlZemZ9hkNnGpsxhiclKrGHN7/aMer08vsMMeJ9MF sqJZo+Yso9HWoGTwPXbjZTMSZG3SbM7jaPOkOAnT8O5atXt8uLoKR4233CrDGeKLKIz5 notlOcwvSi/VrhmxogEQrTM7UvS8JrQmxLQtLmN9o+E5wcwMtv9mL6n1akBHgFo82jzx 3GqCvMVLWgGA3h0VDAyRhD99oNybBj4+IwJfe2pjRXKqKK4wLuLglbyW/udlvCWhCPI6 GQ6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature:dkim-signature; bh=nkuIY6FyiPEzgw97Z8lY8vnbdT3FSmdKYnCQnfTwp/I=; fh=WOL5y5XSTBEiVLRamDMtAZDqoc8L8ZeH+d2OrvrTw20=; b=066yI4zGo8PXbQDo1K3pZ+1LCEUQp0EaErZrpQfqrW3C3uTkDbe5osrHq76LRCTgJe TYcI6LQn/zC03iL6aA0ycs+pO/trZ42BQ4a3kIlyHSLUQPEtG0nhq8MpMMEYfcm5uVKC rvHNLXQi4GD6vF8lJHcYmXnA/2e4vtEhYiiRV2R18HXYytpb6j+V4X4fnegkrB6szM5x zgEHrkYtFGJo3Jy7U7NHPuUzljFuWb1Lh5dMQVAVjp6lkx12nF2McgF9gVoqS5wTUqCV ZGgv6qHrFyORbJIKZXrDIH5lN0Mf97RuzfErA/qVgMCjP5il8jINb+39gKqEwP36krck gNqw==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@atmark-techno.com header.s=gw2_bookworm header.b=luQ94ccy; dkim=pass header.i=@atmark-techno.com header.s=google header.b=DXvx1HeD; spf=pass (google.com: domain of dominique.martinet@atmark-techno.com designates 35.74.137.57 as permitted sender) smtp.mailfrom=dominique.martinet@atmark-techno.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=atmark-techno.com Received: from gw2.atmark-techno.com (gw2.atmark-techno.com. [35.74.137.57]) by gmr-mx.google.com with ESMTPS id ca18e2360f4ac-7e906d4702esi52643239f.3.2024.05.30.01.20.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 May 2024 01:20:22 -0700 (PDT) Received-SPF: pass (google.com: domain of dominique.martinet@atmark-techno.com designates 35.74.137.57 as permitted sender) client-ip=35.74.137.57; Received: from gw2.atmark-techno.com (localhost [127.0.0.1]) by gw2.atmark-techno.com (Postfix) with ESMTP id E61BB9CC for ; Thu, 30 May 2024 17:20:19 +0900 (JST) Received: from mail-pj1-f69.google.com (mail-pj1-f69.google.com [209.85.216.69]) by gw2.atmark-techno.com (Postfix) with ESMTPS id 335857C9 for ; Thu, 30 May 2024 17:20:18 +0900 (JST) Received: by mail-pj1-f69.google.com with SMTP id 98e67ed59e1d1-2bf8a8799f1so563445a91.1 for ; Thu, 30 May 2024 01:20:18 -0700 (PDT) X-Forwarded-Encrypted: i=1; AJvYcCXwUTWJskbEK2T0yw1DD9VC9y15SuypnigO30yMfazmtsTfUS6yQTBgsLROL01biyDPewWtrYpEpFMtff3/EvyQQRZv/Zd9w9NC X-Received: by 2002:a17:90a:cf:b0:2bd:d2f9:fa18 with SMTP id 98e67ed59e1d1-2c1abc4dfb3mr1358521a91.48.1717057217196; Thu, 30 May 2024 01:20:17 -0700 (PDT) X-Received: by 2002:a17:90a:cf:b0:2bd:d2f9:fa18 with SMTP id 98e67ed59e1d1-2c1abc4dfb3mr1358509a91.48.1717057216775; Thu, 30 May 2024 01:20:16 -0700 (PDT) Received: from pc-0182.atmarktech (145.82.198.104.bc.googleusercontent.com. [104.198.82.145]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2c1a776e228sm1093424a91.18.2024.05.30.01.20.16 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 May 2024 01:20:16 -0700 (PDT) Received: from [::1] (helo=pc-0182.atmark.tech) by pc-0182.atmarktech with esmtp (Exim 4.96) (envelope-from ) id 1sCb1D-005zOd-1B; Thu, 30 May 2024 17:20:15 +0900 From: Dominique Martinet To: stefano.babic@swupdate.org, swupdate@googlegroups.com Cc: shinya.koga@atmark-techno.com, Dominique Martinet Subject: [swupdate] [PATCH v3 3/4] downloader: allow common channel settings Date: Thu, 30 May 2024 17:20:06 +0900 Message-Id: <20240530082007.1427631-4-dominique.martinet@atmark-techno.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240530082007.1427631-1-dominique.martinet@atmark-techno.com> References: <20240530082007.1427631-1-dominique.martinet@atmark-techno.com> MIME-Version: 1.0 X-Original-Sender: dominique.martinet@atmark-techno.com X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@atmark-techno.com header.s=gw2_bookworm header.b=luQ94ccy; dkim=pass header.i=@atmark-techno.com header.s=google header.b=DXvx1HeD; spf=pass (google.com: domain of dominique.martinet@atmark-techno.com designates 35.74.137.57 as permitted sender) smtp.mailfrom=dominique.martinet@atmark-techno.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=atmark-techno.com Precedence: list Mailing-list: list swupdate@googlegroups.com; contact swupdate+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: swupdate@googlegroups.com X-Google-Group-Id: 605343134186 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , The previous patch added max-download-speed so just add this one to the config example, but using channel_settings() gets a few others for free if someone ever requires setting them. Signed-off-by: Dominique Martinet Acked-by: Stefano Babic --- v3: no change corelib/downloader.c | 3 +-- examples/configuration/swupdate.cfg | 4 ++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/corelib/downloader.c b/corelib/downloader.c index 1ca530eaae02..5e1006bc9215 100644 --- a/corelib/downloader.c +++ b/corelib/downloader.c @@ -109,10 +109,9 @@ static int download_settings(void *elem, void __attribute__ ((__unused__)) *dat GET_FIELD_INT(LIBCFG_PARSER, elem, "retries", &opt->retries); - GET_FIELD_INT(LIBCFG_PARSER, elem, "retrywait", - &opt->retry_sleep); GET_FIELD_INT(LIBCFG_PARSER, elem, "timeout", &opt->low_speed_timeout); + channel_settings(elem, &channel_options); return 0; } diff --git a/examples/configuration/swupdate.cfg b/examples/configuration/swupdate.cfg index 69a57e619fd1..2702396d54cf 100644 --- a/examples/configuration/swupdate.cfg +++ b/examples/configuration/swupdate.cfg @@ -105,11 +105,15 @@ logcolors : { # authentication : string # credentials needed to get software if server # enables Basic Auth to allow this downloading +# max-download-speed : string +# Specify maximum download speed to use. Value can be expressed as +# B/s, kB/s, M/s, G/s. Example: 512k download : { authentication = "user:password"; retries = 3; timeout = 1800; + max-download-speed = "1M"; retrywait = 5; url = "http://example.com/software.swu"; userid = 1000;