]> 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:45 +0000 (10:11 -0400)
committerMichael R Sweet <msweet@msweet.org>
Wed, 2 Apr 2025 14:11:45 +0000 (10:11 -0400)
scheduler/subscriptions.c

index 7c646b953d9360f931e3068556c261dab9c2cd08..eefa7f82e3313717431166063f549a221ed23855 100644 (file)
@@ -93,6 +93,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))
@@ -119,11 +122,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...