lib/deltas: Check cancellable during processing
authorColin Walters <walters@verbum.org>
Thu, 12 Oct 2017 14:46:25 +0000 (10:46 -0400)
committerSimon McVittie <smcv@debian.org>
Thu, 26 Oct 2017 23:19:45 +0000 (00:19 +0100)
Let's react to `Ctrl-C` faster here. Noticed while I was doing an update on my
desktop and playing with cancellation.

Closes: #1266
Approved by: jlebon
Origin: upstream, 2017.13, commit:a1986b1a8083ef4f840973f1c73d932a52e43644

Gbp-Pq: Topic 2017.13
Gbp-Pq: Name lib-deltas-Check-cancellable-during-processing.patch

src/libostree/ostree-repo-static-delta-processing.c

index 844de2c6537322306eaf3909bee8c5fd2286d412..78bf7e16a65ebdf23de71ad14b70a1f597bf638c 100644 (file)
@@ -229,6 +229,9 @@ _ostree_static_delta_part_execute (OstreeRepo      *repo,
       state->oplen--;
       state->opdata++;
 
+      if (g_cancellable_set_error_if_cancelled (cancellable, error))
+        goto out;
+
       switch (opcode)
         {
         case OSTREE_STATIC_DELTA_OP_OPEN_SPLICE_AND_CLOSE: