{
struct cache_file *file, *tmp;
+ session_cleanup(&state->session);
+ memset(&state->session, 0, sizeof(state->session));
+
HASH_ITER(hh, state->files, file, tmp) {
file_rm_f(file->map.path);
free(file);
}
- session_cleanup(&state->session);
- clear_delta_hashes(state);
/* Leave the seq alive */
+
+ clear_delta_hashes(state);
}
static struct cache_file *
file = cache_file_add(args->state, &tag.meta.uri, path);
}
- pr_clutter("echo '$%s' > %s", file->map.url, file->map.path);
+ pr_clutter("echo '$%s' > %s", uri_str(&file->map.url), file->map.path);
error = file_write_bin(file->map.path, tag.content, tag.content_len);
end: metadata_cleanup(&tag.meta);
if (strcmp(old->session.session_id, new.session.session_id) != 0) {
pr_trc("The session changed. (Was %s)", old->session.session_id);
- /*
- * The problem with keeping both sessions is that session_id
- * does not exist outside of RRDP, which means callers don't
- * know which to ask for, which means I'd have to manage
- * different tiers of fallbacks, and it's too late for that now.
- */
rrdp_state_reset(old);
-
error = handle_snapshot(&new, old);
if (error) {
rrdp_state_free(old);
snapshot_fallback:
pr_trc("Falling back to snapshot.");
+ rrdp_state_reset(old);
error = handle_snapshot(&new, old);
if (error)
goto clean_notif;