diff --git a/repos/libports/src/app/fetchurl/README b/repos/libports/src/app/fetchurl/README index c21ce1acab..0a3fa0dc27 100644 --- a/repos/libports/src/app/fetchurl/README +++ b/repos/libports/src/app/fetchurl/README @@ -8,6 +8,12 @@ for a given amount of time, the transfer will be aborted. The duration can be set by setting the 'progress_timeout' attribute in the '' node. It is specified in milliseconds and the default value is 10 seconds. +The 'ignore_failures' attribute instructs the component to always report +success (via exit-code 0). It is useful when batching is used where a +failed fetch operation should not influence the over-all result. The default +value is 'false'. + + The following config snippets illustrate its usage. Load the socket plugin in to the fetchurl binary (print output to log): diff --git a/repos/libports/src/app/fetchurl/component.cc b/repos/libports/src/app/fetchurl/component.cc index c6567aab91..5236096ad1 100644 --- a/repos/libports/src/app/fetchurl/component.cc +++ b/repos/libports/src/app/fetchurl/component.cc @@ -115,6 +115,8 @@ struct Fetchurl::Main Genode::Milliseconds _progress_timeout { 10u * 1000 }; + bool _ignore_result { false }; + void _schedule_report() { using namespace Genode; @@ -189,6 +191,9 @@ struct Fetchurl::Main }; config_node.for_each_sub_node("fetch", parse_fn); + + _ignore_result = config_node.attribute_value("ignore_failures", + _ignore_result); } Main(Libc::Env &e) : _env(e) @@ -332,7 +337,8 @@ struct Fetchurl::Main curl_easy_cleanup(curl); - return exit_res ^ CURLE_OK; + int const result = exit_res ^ CURLE_OK; + return _ignore_result ? 0 : result; } };