mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-29 15:44:02 +00:00
fetchurl: add 'verbose' config option
This commit introduces a config option to enable verbose operations. This can be used to ease debugging. Issue #5184.
This commit is contained in:
parent
344831ec06
commit
2be57e4156
@ -13,6 +13,8 @@ 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
|
failed fetch operation should not influence the over-all result. The default
|
||||||
value is 'false'.
|
value is 'false'.
|
||||||
|
|
||||||
|
The 'verbose' attribute instruct the component to increase its verbosity
|
||||||
|
and show diagnostic messages during its operation.
|
||||||
|
|
||||||
The following config snippets illustrate its usage.
|
The following config snippets illustrate its usage.
|
||||||
|
|
||||||
|
@ -117,6 +117,8 @@ struct Fetchurl::Main
|
|||||||
|
|
||||||
bool _ignore_result { false };
|
bool _ignore_result { false };
|
||||||
|
|
||||||
|
bool _verbose { false };
|
||||||
|
|
||||||
void _schedule_report()
|
void _schedule_report()
|
||||||
{
|
{
|
||||||
using namespace Genode;
|
using namespace Genode;
|
||||||
@ -194,6 +196,8 @@ struct Fetchurl::Main
|
|||||||
|
|
||||||
_ignore_result = config_node.attribute_value("ignore_failures",
|
_ignore_result = config_node.attribute_value("ignore_failures",
|
||||||
_ignore_result);
|
_ignore_result);
|
||||||
|
|
||||||
|
_verbose = config_node.attribute_value("verbose", false);
|
||||||
}
|
}
|
||||||
|
|
||||||
Main(Libc::Env &e) : _env(e)
|
Main(Libc::Env &e) : _env(e)
|
||||||
@ -213,6 +217,7 @@ struct Fetchurl::Main
|
|||||||
for (size_t sub_path_len = 0; ; sub_path_len++) {
|
for (size_t sub_path_len = 0; ; sub_path_len++) {
|
||||||
|
|
||||||
bool const end_of_path = (out_path[sub_path_len] == 0);
|
bool const end_of_path = (out_path[sub_path_len] == 0);
|
||||||
|
|
||||||
bool const end_of_elem = (out_path[sub_path_len] == '/');
|
bool const end_of_elem = (out_path[sub_path_len] == '/');
|
||||||
|
|
||||||
if (end_of_path)
|
if (end_of_path)
|
||||||
@ -262,7 +267,8 @@ struct Fetchurl::Main
|
|||||||
}
|
}
|
||||||
_fetch.fd = fd;
|
_fetch.fd = fd;
|
||||||
|
|
||||||
curl_easy_setopt(_curl, CURLOPT_VERBOSE, 1L);
|
if (_verbose)
|
||||||
|
curl_easy_setopt(_curl, CURLOPT_VERBOSE, 1L);
|
||||||
|
|
||||||
curl_easy_setopt(_curl, CURLOPT_URL, _fetch.url.string());
|
curl_easy_setopt(_curl, CURLOPT_URL, _fetch.url.string());
|
||||||
curl_easy_setopt(_curl, CURLOPT_FOLLOWLOCATION, true);
|
curl_easy_setopt(_curl, CURLOPT_FOLLOWLOCATION, true);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user