summaryrefslogtreecommitdiff
path: root/scheduler/job.c
diff options
context:
space:
mode:
authorMichael Sweet <michael.r.sweet@gmail.com>2016-05-11 10:35:53 -0400
committerMichael Sweet <michael.r.sweet@gmail.com>2016-05-11 10:35:53 -0400
commite0f489cd21441b7b45543a31ba6cbeb0bf85cd4f (patch)
tree6e84e12d2d9915bd66a929a94e03db6efafa90c3 /scheduler/job.c
parent1e56f93b01c65b84e920d068b88bfc94204ea055 (diff)
Fix Hold-New-Jobs implementation (Issue #4767)
Diffstat (limited to 'scheduler/job.c')
-rw-r--r--scheduler/job.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/scheduler/job.c b/scheduler/job.c
index 784490e08..53af00319 100644
--- a/scheduler/job.c
+++ b/scheduler/job.c
@@ -227,6 +227,7 @@ cupsdCheckJobs(void)
*pclass; /* Printer class destination */
ipp_attribute_t *attr; /* Job attribute */
time_t curtime; /* Current time */
+ const char *reasons; /* job-state-reasons value */
curtime = time(NULL);
@@ -321,6 +322,25 @@ cupsdCheckJobs(void)
cupsdContinueJob(job);
/*
+ * Skip jobs that where held-on-create
+ */
+
+ reasons = ippGetString(job->reasons, 0, NULL);
+ if (reasons && !strcmp(reasons, "job-held-on-create"))
+ {
+ /*
+ * Check whether the printer is still holding new jobs...
+ */
+
+ printer = cupsdFindDest(job->dest);
+
+ if (printer->holding_new_jobs)
+ continue;
+
+ ippSetString(job->attrs, &job->reasons, 0, "none");
+ }
+
+ /*
* Start pending jobs if the destination is available...
*/
@@ -357,7 +377,7 @@ cupsdCheckJobs(void)
"Job aborted because the destination printer/class "
"has gone away.");
}
- else if (printer && !printer->holding_new_jobs)
+ else if (printer)
{
/*
* See if the printer is available or remote and not printing a job;