|
 |
a17bb8 |
From 3e4dd41459dabc5d18edbe06eb5b81291885204b Mon Sep 17 00:00:00 2001
|
|
 |
a17bb8 |
From: Michael R Sweet <michael.r.sweet@gmail.com>
|
|
 |
a17bb8 |
Date: Wed, 5 Dec 2018 12:18:19 -0500
|
|
 |
a17bb8 |
Subject: [PATCH] Fix handling of MaxJobTime 0 (Issue #5438)
|
|
 |
a17bb8 |
|
|
 |
a17bb8 |
---
|
|
 |
a17bb8 |
CHANGES.md | 5 +++--
|
|
 |
a17bb8 |
scheduler/job.c | 4 +++-
|
|
 |
a17bb8 |
scheduler/printers.c | 2 +-
|
|
 |
a17bb8 |
3 files changed, 7 insertions(+), 4 deletions(-)
|
|
 |
a17bb8 |
|
|
 |
a17bb8 |
diff --git a/scheduler/job.c b/scheduler/job.c
|
|
 |
a17bb8 |
index 3cbe56aa8..638f256db 100644
|
|
 |
a17bb8 |
--- a/scheduler/job.c
|
|
 |
a17bb8 |
+++ b/scheduler/job.c
|
|
 |
a17bb8 |
@@ -5148,8 +5148,10 @@ update_job(cupsd_job_t *job) /* I - Job to check */
|
|
 |
a17bb8 |
|
|
 |
a17bb8 |
if (cancel_after)
|
|
 |
a17bb8 |
job->cancel_time = time(NULL) + ippGetInteger(cancel_after, 0);
|
|
 |
a17bb8 |
- else
|
|
 |
a17bb8 |
+ else if (MaxJobTime > 0)
|
|
 |
a17bb8 |
job->cancel_time = time(NULL) + MaxJobTime;
|
|
 |
a17bb8 |
+ else
|
|
 |
a17bb8 |
+ job->cancel_time = 0;
|
|
 |
a17bb8 |
}
|
|
 |
a17bb8 |
}
|
|
 |
a17bb8 |
}
|
|
 |
a17bb8 |
diff --git a/scheduler/printers.c b/scheduler/printers.c
|
|
 |
a17bb8 |
index bb99907ad..68239d85d 100644
|
|
 |
a17bb8 |
--- a/scheduler/printers.c
|
|
 |
a17bb8 |
+++ b/scheduler/printers.c
|
|
 |
a17bb8 |
@@ -3370,7 +3370,7 @@ add_printer_defaults(cupsd_printer_t *p)/* I - Printer */
|
|
 |
a17bb8 |
"document-format-default", NULL, "application/octet-stream");
|
|
 |
a17bb8 |
|
|
 |
a17bb8 |
if (!cupsGetOption("job-cancel-after", p->num_options, p->options))
|
|
 |
a17bb8 |
- ippAddInteger(p->attrs, IPP_TAG_PRINTER, IPP_TAG_INTEGER,
|
|
 |
a17bb8 |
+ ippAddInteger(p->attrs, IPP_TAG_PRINTER, MaxJobTime > 0 ? IPP_TAG_INTEGER : IPP_TAG_NOVALUE,
|
|
 |
a17bb8 |
"job-cancel-after-default", MaxJobTime);
|
|
 |
a17bb8 |
|
|
 |
a17bb8 |
if (!cupsGetOption("job-hold-until", p->num_options, p->options))
|
|
 |
a17bb8 |
--
|
|
 |
a17bb8 |
2.31.1
|
|
 |
a17bb8 |
|