From 142a7fd85582dcbf2bb35f33ab3f3469bccdb863 Mon Sep 17 00:00:00 2001 From: Umang Jain Date: Fri, 1 Nov 2019 14:25:13 +0530 Subject: [PATCH] dir: Immediately return if getting remote state is cancelled Immediately return the error instead of saving the error and continuing on an optional codepath if _flatpak_dir_get_remote_state is cancelled. --- common/flatpak-dir.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/flatpak-dir.c b/common/flatpak-dir.c index 635d4102..1b9b6338 100644 --- a/common/flatpak-dir.c +++ b/common/flatpak-dir.c @@ -11189,7 +11189,7 @@ _flatpak_dir_get_remote_state (FlatpakDir *self, } else { - if (optional) + if (optional && !g_cancellable_is_cancelled (cancellable)) { state->summary_fetch_error = g_steal_pointer (&local_error); g_debug ("Failed to download optional summary"); @@ -11218,7 +11218,7 @@ _flatpak_dir_get_remote_state (FlatpakDir *self, if (!_flatpak_dir_fetch_remote_state_metadata_branch (self, state, only_cached, cancellable, &local_error) && !g_error_matches (local_error, FLATPAK_ERROR, FLATPAK_ERROR_DOWNGRADE)) { - if (optional) + if (optional && !g_cancellable_is_cancelled (cancellable)) { /* This happens for instance in the case where a p2p remote is invalid (wrong signature) and we should just silently fail to update to it. */