Skip to content

Commit

Permalink
libostree: Ensure progress keys are all always set
Browse files Browse the repository at this point in the history
If one of the progress keys is set in a pull operation, a ::changed
signal is emitted on the progress object, and the callback for that
could query any of the progress keys — so they all need to be set,
otherwise we get an assertion failure in ostree_async_progress_get() due
to a named key not existing.

Spotted by Dan Nicholson in PR ostreedev#819.

Signed-off-by: Philip Withnall <[email protected]>
  • Loading branch information
pwithnall committed May 5, 2017
1 parent 64322c7 commit 0d521ca
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/libostree/ostree-repo-pull.c
Original file line number Diff line number Diff line change
Expand Up @@ -3477,6 +3477,9 @@ ostree_repo_pull_with_options (OstreeRepo *self,
guint shift;
GString *buf = g_string_new ("");

/* Ensure the rest of the progress keys are set appropriately. */
update_progress (pull_data);

if (bytes_transferred < 1024)
shift = 1;
else
Expand Down

0 comments on commit 0d521ca

Please sign in to comment.