diff options
author | Georges Basile Stavracas Neto <georges.stavracas@gmail.com> | 2016-08-31 12:02:01 -0300 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2016-08-31 15:21:06 +0000 |
commit | cafc517c6bb93bb45777b6969125cb9599f217f6 (patch) | |
tree | d7df9f71a54583e3d3da96cec329bee66eda5731 | |
parent | 1dc69dc879612abfd6509a1e81c04990fed8ea49 (diff) | |
download | ostree-cafc517c6bb93bb45777b6969125cb9599f217f6.tar.gz |
repo-pull: properly store the cancellable
OSTree function ostree_repo_pull_with_options starts a
series of operations that makes heavy use of the PullData's
cancellable.
This isn't effective, however, since nowhere in the code
the OtPullData.cancellable field is set. This is visible,
for example, when trying to cancel a Flatpak pull and nothing
happens, because the cancellable is not properly passed
to the pull data.
Fix that by setting the cancellable field of the pull data. It
owns a reference for safety reasons, and unreferences it at the
end of the operation.
ostreedev/ostree#482
Closes: #483
Approved by: cgwalters
-rw-r--r-- | src/libostree/ostree-repo-pull.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/libostree/ostree-repo-pull.c b/src/libostree/ostree-repo-pull.c index 604e8254..ed1c67ef 100644 --- a/src/libostree/ostree-repo-pull.c +++ b/src/libostree/ostree-repo-pull.c @@ -2252,6 +2252,7 @@ ostree_repo_pull_with_options (OstreeRepo *self, pull_data->is_mirror = (flags & OSTREE_REPO_PULL_FLAGS_MIRROR) > 0; pull_data->is_commit_only = (flags & OSTREE_REPO_PULL_FLAGS_COMMIT_ONLY) > 0; pull_data->is_untrusted = (flags & OSTREE_REPO_PULL_FLAGS_UNTRUSTED) > 0; + pull_data->cancellable = cancellable ? g_object_ref (cancellable) : NULL; if (error) pull_data->async_error = &pull_data->cached_async_error; @@ -2895,6 +2896,7 @@ ostree_repo_pull_with_options (OstreeRepo *self, g_source_destroy (update_timeout); g_strfreev (configured_branches); g_clear_object (&pull_data->fetcher); + g_clear_object (&pull_data->cancellable); g_clear_object (&pull_data->remote_repo_local); g_free (pull_data->remote_name); if (pull_data->base_uri) |