lib/repo: Fix handling of missing summary files when downloading

The API for downloading a summary file can legitimately return NULL for
the summary file contents when it returns TRUE (success). This indicates
an error 404 — the summary file was not found.

Two call sites were not handling that correctly, which was causing later
assertion failures.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Closes: #1061

Closes: #1065
Approved by: cgwalters
This commit is contained in:
Philip Withnall authored and Atomic Bot committed 2017-08-08 15:33:45 +00:00
1 parent 86dce4b252
commit 1672e2eee0
2 files changed
+17 -1

No files matched your search

+8
View File
@@ -4834,6 +4834,14 @@ find_remotes_cb (GObject *obj,
g_clear_error (&error);
continue;
}
else if (summary_bytes == NULL)
{
g_debug ("%s: Failed to download summary for result ‘%s’. Ignoring. %s",
G_STRFUNC, result->remote->name,
"No summary file exists on server");
g_clear_pointer (&g_ptr_array_index (results, i), (GDestroyNotify) ostree_repo_finder_result_free);
continue;
}
/* Check the metadata in the summary file, especially whether it contains
* all the @refs we are interested in. */