Describe the bug
The job-completed notification is not delivered to a printer subscription when the job is canceled.
Currently, this event is only delivered for job subscription or whole server subscriptions.
To Reproduce
Steps to reproduce the behavior:
- Create a printer subscription for at least the job-completed event
- Pause the printer (to be able to cancel the job)
- Print a document to the printer
- Cancel the job
Expected behavior
A job-completed notification should be send for the printer subscription.
Possible solution
This issue is caused by job->printer only being set when the job actually starts printing. Hence, when cupsdSetJobState is called for the canceled job, a null pointer is passed to cupsdAddEvent for the dest argument.
It may be solved by adding the following lines to the cupsAddEvent function:
if (!dest && job && job->dest)
dest = cupsdFindDest(job->dest); // lookup the printer if it is not explicitly provided and the job contains a named destination
System Information:
All OSes / cups versions
Describe the bug
The
job-completednotification is not delivered to a printer subscription when the job is canceled.Currently, this event is only delivered for job subscription or whole server subscriptions.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
A
job-completednotification should be send for the printer subscription.Possible solution
This issue is caused by
job->printeronly being set when the job actually starts printing. Hence, whencupsdSetJobStateis called for the canceled job, a null pointer is passed tocupsdAddEventfor thedestargument.It may be solved by adding the following lines to the
cupsAddEventfunction:System Information:
All OSes / cups versions