From 31414cd2ab6634c53a5ca31531674a82bf778d1c Mon Sep 17 00:00:00 2001 From: Alberto Leiva Popper Date: Wed, 13 Dec 2023 15:40:35 -0600 Subject: [PATCH] Improve HTTP info logging Before: Downloading 'https://test.rpki/notification.xml'. HTTP GET: https://test.rpki/notification.xml -> cache/tmp/1 The first line was redundant, and the target wasn't very helpful. Now: HTTP GET: https://test.rpki/notification.xml -> cache/test.tal/https/test.rpki/notification.xml --- src/http/http.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/http/http.c b/src/http/http.c index 27a10b9a..53a681b7 100644 --- a/src/http/http.c +++ b/src/http/http.c @@ -291,7 +291,6 @@ http_fetch(char const *src, char const *dst, curl_off_t ims, bool *changed) args.file = NULL; setopt_writedata(handler.curl, &args); - pr_val_info("HTTP GET: %s -> %s", src, dst); res = curl_easy_perform(handler.curl); /* write_callback() */ if (args.file != NULL) file_close(args.file); @@ -363,7 +362,7 @@ do_retries(char const *src, char const *dst, curl_off_t ims, bool *changed) unsigned int r; int error; - pr_val_info("Downloading '%s'.", src); + pr_val_debug("Downloading '%s'.", src); r = 0; do { @@ -428,6 +427,8 @@ http_download(struct rpki_uri *uri, bool *changed) if (error) goto end; + pr_val_info("HTTP GET: %s -> %s", uri_get_global(uri), final_file_name); + error = do_retries(uri_get_global(uri), tmp_file_name, (curl_off_t)ims, changed); if (error || !(*changed)) @@ -460,5 +461,6 @@ int http_direct_download(char const *remote, char const *dest) { bool changed; + pr_val_info("HTTP GET: %s -> %s", remote, dest); return http_fetch(remote, dest, 0, &changed); } -- 2.47.3