Message ID | 20240530082007.1427631-4-dominique.martinet@atmark-techno.com |
---|---|
State | Accepted |
Headers | show |
Series | downloader curl options: add max-download-speed | expand |
On 30.05.24 10:20, Dominique Martinet wrote: > 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 <dominique.martinet@atmark-techno.com> > --- > 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; Acked-by: Stefano Babic <stefano.babic@swupdate.org>
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;
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 <dominique.martinet@atmark-techno.com> --- v3: no change corelib/downloader.c | 3 +-- examples/configuration/swupdate.cfg | 4 ++++ 2 files changed, 5 insertions(+), 2 deletions(-)