Skip to content

Commit 761272c

Browse files
committed
Fix job-completed event notifications for jobs that are canceled before they are started (Issue #1209)
1 parent 36c5154 commit 761272c

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

scheduler/subscriptions.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,9 @@ cupsdAddEvent(
8989
* caches...
9090
*/
9191

92+
if (job && !dest)
93+
dest = cupsdFindPrinter(job->dest);
94+
9295
for (temp = NULL, sub = (cupsd_subscription_t *)cupsArrayFirst(Subscriptions);
9396
sub;
9497
sub = (cupsd_subscription_t *)cupsArrayNext(Subscriptions))
@@ -115,11 +118,7 @@ cupsdAddEvent(
115118
temp->time = time(NULL);
116119
temp->attrs = ippNew();
117120
temp->job = job;
118-
119-
if (dest)
120-
temp->dest = dest;
121-
else if (job)
122-
temp->dest = dest = cupsdFindPrinter(job->dest);
121+
temp->dest = dest;
123122

124123
/*
125124
* Add common event notification attributes...

0 commit comments

Comments
 (0)