]> git.ipfire.org Git - thirdparty/FORT-validator.git/commitdiff
Don't store downloaded URI when forcing rsync and log rsync'd URI
authorpcarana <pc.moreno2099@gmail.com>
Tue, 2 Jul 2019 19:44:38 +0000 (14:44 -0500)
committerpcarana <pc.moreno2099@gmail.com>
Wed, 3 Jul 2019 20:32:30 +0000 (15:32 -0500)
src/object/certificate.c
src/rsync/rsync.c

index 961eddc5bcee5cf14fc91c3002a73c721ef10f1b..37bc077c3a7dcf1ba404f06e11923c29db7b8c1c 100644 (file)
@@ -1486,13 +1486,17 @@ certificate_traverse(struct rpp *rpp_parent, struct rpki_uri *cert_uri)
        mft_retry = true;
        do {
                error = handle_manifest(mft, rpp_parent_crl, &pp);
+               if (!mft_retry)
+                       uri_refput(mft);
                if (!error || !mft_retry)
                        break;
 
-               pr_info("Retrying repository download to discard 'transient inconsistency' manifest issue (see RFC 6481 section 5)");
+               pr_info("Retrying repository download to discard 'transient inconsistency' manifest issue (see RFC 6481 section 5) '%s'",
+                   uri_get_printable(caRepository));
                error = download_files(caRepository, false, true);
                if (error)
                        break;
+               uri_refget(mft);
                mft_retry = false;
        } while (true);
 
index d6c9ccb36b42e7898c1182c9a14d9e3f71984f81..5065dcea07b683f80bd43169d4fa1461e2cc23a0 100644 (file)
@@ -392,8 +392,9 @@ download_files(struct rpki_uri *requested_uri, bool is_ta, bool force)
 
        pr_debug("Going to RSYNC '%s'.", uri_get_printable(rsync_uri));
 
+       /* Don't store when "force" and if its already downloaded */
        error = do_rsync(rsync_uri, is_ta);
-       if (!error)
+       if (!error && !(force && is_already_downloaded(rsync_uri)))
                error = mark_as_downloaded(rsync_uri);
 
        uri_refput(rsync_uri);