diff options
author | Michael Sweet <michael.r.sweet@gmail.com> | 2016-05-11 10:35:53 -0400 |
---|---|---|
committer | Michael Sweet <michael.r.sweet@gmail.com> | 2016-05-11 10:35:53 -0400 |
commit | e0f489cd21441b7b45543a31ba6cbeb0bf85cd4f (patch) | |
tree | 6e84e12d2d9915bd66a929a94e03db6efafa90c3 /scheduler/ipp.c | |
parent | 1e56f93b01c65b84e920d068b88bfc94204ea055 (diff) |
Fix Hold-New-Jobs implementation (Issue #4767)
Diffstat (limited to 'scheduler/ipp.c')
-rw-r--r-- | scheduler/ipp.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/scheduler/ipp.c b/scheduler/ipp.c index cc6e70eab..c0c2222f0 100644 --- a/scheduler/ipp.c +++ b/scheduler/ipp.c @@ -1694,7 +1694,24 @@ add_job(cupsd_client_t *con, /* I - Client connection */ attr = ippAddString(job->attrs, IPP_TAG_JOB, IPP_TAG_KEYWORD, "job-hold-until", NULL, val); } - if (attr && strcmp(attr->values[0].string.text, "no-hold")) + + if (printer->holding_new_jobs) + { + /* + * Hold all new jobs on this printer... + */ + + if (attr && strcmp(attr->values[0].string.text, "no-hold")) + cupsdSetJobHoldUntil(job, ippGetString(attr, 0, NULL), 0); + else + cupsdSetJobHoldUntil(job, "indefinite", 0); + + job->state->values[0].integer = IPP_JOB_HELD; + job->state_value = IPP_JOB_HELD; + + ippSetString(job->attrs, &job->reasons, 0, "job-held-on-create"); + } + else if (attr && strcmp(attr->values[0].string.text, "no-hold")) { /* * Hold job until specified time... @@ -8888,6 +8905,8 @@ release_held_new_jobs( "Printer \"%s\" now printing pending/new jobs (\"%s\").", printer->name, get_username(con)); + cupsdCheckJobs(); + /* * Everything was ok, so return OK status... */ |