summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2018-12-05 12:18:19 -0500
committerDidier Raboud <odyx@debian.org>2018-12-06 19:04:49 +0100
commitf041add696fa992dedbe80b5111856a47efeb915 (patch)
tree006a7a9db0e7888f5291ca1eaad5663adfb0ffc8
parent44c5ad66b87ad11cc8d45497034e3ada8f36f09a (diff)
Fix handling of MaxJobTime 0 (Issue #5438)
-rw-r--r--scheduler/job.c4
-rw-r--r--scheduler/printers.c2
2 files changed, 4 insertions, 2 deletions
diff --git a/scheduler/job.c b/scheduler/job.c
index 1fdd3153a..ef1f5c5b4 100644
--- a/scheduler/job.c
+++ b/scheduler/job.c
@@ -5130,8 +5130,10 @@ update_job(cupsd_job_t *job) /* I - Job to check */
if (cancel_after)
job->cancel_time = time(NULL) + ippGetInteger(cancel_after, 0);
- else
+ else if (MaxJobTime > 0)
job->cancel_time = time(NULL) + MaxJobTime;
+ else
+ job->cancel_time = 0;
}
}
}
diff --git a/scheduler/printers.c b/scheduler/printers.c
index 46ec0e836..fda5316ee 100644
--- a/scheduler/printers.c
+++ b/scheduler/printers.c
@@ -3445,7 +3445,7 @@ add_printer_defaults(cupsd_printer_t *p)/* I - Printer */
"document-format-default", NULL, "application/octet-stream");
if (!cupsGetOption("job-cancel-after", p->num_options, p->options))
- ippAddInteger(p->attrs, IPP_TAG_PRINTER, IPP_TAG_INTEGER,
+ ippAddInteger(p->attrs, IPP_TAG_PRINTER, MaxJobTime > 0 ? IPP_TAG_INTEGER : IPP_TAG_NOVALUE,
"job-cancel-after-default", MaxJobTime);
if (!cupsGetOption("job-hold-until", p->num_options, p->options))