You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
1.5 KiB
44 lines
1.5 KiB
2 years ago
|
From 3e4dd41459dabc5d18edbe06eb5b81291885204b Mon Sep 17 00:00:00 2001
|
||
|
From: Michael R Sweet <michael.r.sweet@gmail.com>
|
||
|
Date: Wed, 5 Dec 2018 12:18:19 -0500
|
||
|
Subject: [PATCH] Fix handling of MaxJobTime 0 (Issue #5438)
|
||
|
|
||
|
---
|
||
|
CHANGES.md | 5 +++--
|
||
|
scheduler/job.c | 4 +++-
|
||
|
scheduler/printers.c | 2 +-
|
||
|
3 files changed, 7 insertions(+), 4 deletions(-)
|
||
|
|
||
|
diff --git a/scheduler/job.c b/scheduler/job.c
|
||
|
index 3cbe56aa8..638f256db 100644
|
||
|
--- a/scheduler/job.c
|
||
|
+++ b/scheduler/job.c
|
||
|
@@ -5148,8 +5148,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 bb99907ad..68239d85d 100644
|
||
|
--- a/scheduler/printers.c
|
||
|
+++ b/scheduler/printers.c
|
||
|
@@ -3370,7 +3370,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))
|
||
|
--
|
||
|
2.31.1
|
||
|
|