From: Michael R Sweet Date: Wed, 2 Apr 2025 14:11:45 +0000 (-0400) Subject: Fix job-completed event notifications for jobs that are canceled before they are... X-Git-Tag: v2.4.12~17 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d5166610fe6631f6ba8abc213778e1fe803dbcc7;p=thirdparty%2Fcups.git Fix job-completed event notifications for jobs that are canceled before they are started (Issue #1209) --- diff --git a/scheduler/subscriptions.c b/scheduler/subscriptions.c index 7c646b953d..eefa7f82e3 100644 --- a/scheduler/subscriptions.c +++ b/scheduler/subscriptions.c @@ -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...