From f28e62add1eb508bbfe97aab94743b129d1422ee Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Wed, 17 Apr 2019 11:40:26 -0400 Subject: [PATCH] oci: Handle cancellations for appstream When an appstream update is cancelled while downloading icons, properly fail. Otherwise, the next update attempt will see an up-to-date timestamp, think everyhing is ok and not download the missing icons. Closes: https://github.com/flatpak/flatpak/issues/2835 Closes: #2836 Approved by: alexlarsson --- common/flatpak-oci-registry.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/common/flatpak-oci-registry.c b/common/flatpak-oci-registry.c index 07b1224f..20b1e682 100644 --- a/common/flatpak-oci-registry.c +++ b/common/flatpak-oci-registry.c @@ -2465,6 +2465,9 @@ flatpak_oci_index_make_appstream (SoupSession *soup_session, } } + if (g_cancellable_set_error_if_cancelled (cancellable, error)) + return NULL; + if (!flatpak_appstream_xml_root_to_data (appstream_root, &bytes, NULL, error)) return NULL;