From 78f40136dbf8411a66ce3f6d8263d8e72d951163 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Wed, 30 May 2018 12:00:22 +0100 Subject: [PATCH] lib/repo-pull: Add some missing assertions for progress statistics Various of the counters already have assertions like this; add some more for total paranoia. Signed-off-by: Philip Withnall Closes: #1594 Approved by: jlebon --- src/libostree/ostree-repo-pull.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/libostree/ostree-repo-pull.c b/src/libostree/ostree-repo-pull.c index 668968e6..83ccff5c 100644 --- a/src/libostree/ostree-repo-pull.c +++ b/src/libostree/ostree-repo-pull.c @@ -1119,6 +1119,7 @@ content_fetch_on_complete (GObject *object, } out: + g_assert (pull_data->n_outstanding_content_fetches > 0); pull_data->n_outstanding_content_fetches--; if (_ostree_fetcher_should_retry_request (local_error, fetch_data->n_retries_remaining--)) @@ -1168,6 +1169,7 @@ on_metadata_written (GObject *object, queue_scan_one_metadata_object_c (pull_data, csum, objtype, fetch_data->path, 0, fetch_data->requested_ref); out: + g_assert (pull_data->n_outstanding_metadata_write_requests > 0); pull_data->n_outstanding_metadata_write_requests--; fetch_object_data_free (fetch_data);