]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Fix job-completed event notifications for jobs that are canceled before they are...
authorMichael R Sweet <msweet@msweet.org>
Wed, 2 Apr 2025 14:11:14 +0000 (10:11 -0400)
committerMichael R Sweet <msweet@msweet.org>
Wed, 2 Apr 2025 14:11:14 +0000 (10:11 -0400)
scheduler/subscriptions.c

index 4e42c9c09df11fb2929a4f2e4059e0b102d0f530..f10b217164d9328fd77509aec97d51d26a782e68 100644 (file)
@@ -89,6 +89,9 @@ cupsdAddEvent(
   * caches...
   */
 
+  if (job && !dest)
+    dest = cupsdFindPrinter(job->dest);
+
   for (temp = NULL, sub = (cupsd_subscription_t *)cupsArrayFirst(Subscriptions);
        sub;
        sub = (cupsd_subscription_t *)cupsArrayNext(Subscriptions))
@@ -115,11 +118,7 @@ cupsdAddEvent(
       temp->time  = time(NULL);
       temp->attrs = ippNew();
       temp->job          = job;
-
-      if (dest)
-       temp->dest = dest;
-      else if (job)
-       temp->dest = dest = cupsdFindPrinter(job->dest);
+      temp->dest  = dest;
 
      /*
       * Add common event notification attributes...