]> git.ipfire.org Git - thirdparty/FORT-validator.git/commitdiff
Improve HTTP info logging
authorAlberto Leiva Popper <ydahhrk@gmail.com>
Wed, 13 Dec 2023 21:40:35 +0000 (15:40 -0600)
committerAlberto Leiva Popper <ydahhrk@gmail.com>
Wed, 13 Dec 2023 21:57:36 +0000 (15:57 -0600)
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

index 27a10b9a8767c929a60791432c3868ccdc59a9c6..53a681b789aed143cba3f35f2ba9c5cbc7c5e6e9 100644 (file)
@@ -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);
 }