Skip to content

Commit

Permalink
downloader: allow common channel settings
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Stefano Babic <[email protected]>
  • Loading branch information
martinetd authored and sbabic committed May 30, 2024
1 parent 1ba3c25 commit 994d87c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 1 addition & 2 deletions corelib/downloader.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
4 changes: 4 additions & 0 deletions examples/configuration/swupdate.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 994d87c

Please sign in to comment.