From: Alberto Leiva Popper Date: Mon, 27 Apr 2026 21:37:47 +0000 (-0600) Subject: Do not delete RPP files if snapshot is already exploded X-Git-Tag: 1.6.8~3^2~1 X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=284023585ea74d64175c5e25ec674a563aa9e81c;p=thirdparty%2FFORT-validator.git Do not delete RPP files if snapshot is already exploded There are situations in which the code might find itself attempting to explode a snapshot a second time during a validation run. The code was noticing this, and thus skipping the second download. But by then, the cached files were already deleted. Which resulted in the validation code receiving zero files as input. --- diff --git a/src/rrdp.c b/src/rrdp.c index 4d5355b6..684b4aaa 100644 --- a/src/rrdp.c +++ b/src/rrdp.c @@ -871,28 +871,27 @@ handle_snapshot(struct update_notification *notif) { struct validation *state; struct rpki_uri *uri; + bool changed; int error; state = state_retrieve(); - - delete_rpp(tal_get_file_name(validation_tal(state)), notif->uri); - uri = notif->snapshot.uri; pr_val_debug("Processing snapshot '%s'.", uri_val_get_printable(uri)); fnstack_push_uri(uri); /* - * TODO (performance) Is there a point in caching the snapshot? - * Especially considering we delete it 4 lines afterwards. - * Maybe stream it instead. - * Same for deltas. + * TODO (performance) There's no point in caching the snapshot. + * Stream it instead. Same for deltas. */ - error = cache_download(validation_cache(state), uri, NULL); + error = cache_download(validation_cache(state), uri, &changed); if (error) goto end; - error = parse_snapshot(notif); - delete_file(uri); + if (changed) { + delete_rpp(tal_get_file_name(validation_tal(state)), notif->uri); + error = parse_snapshot(notif); + delete_file(uri); + } end: fnstack_pop();