From: pcarana Date: Tue, 2 Jul 2019 19:44:38 +0000 (-0500) Subject: Don't store downloaded URI when forcing rsync and log rsync'd URI X-Git-Tag: v1.1.0~1^2~23 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=36fa0a00e8b2479ac6b0e8f94a07339b67c83fa9;p=thirdparty%2FFORT-validator.git Don't store downloaded URI when forcing rsync and log rsync'd URI --- diff --git a/src/object/certificate.c b/src/object/certificate.c index 961eddc5..37bc077c 100644 --- a/src/object/certificate.c +++ b/src/object/certificate.c @@ -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); diff --git a/src/rsync/rsync.c b/src/rsync/rsync.c index d6c9ccb3..5065dcea 100644 --- a/src/rsync/rsync.c +++ b/src/rsync/rsync.c @@ -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);