Index: doc/help/ref-cupsd-conf.html.in
===================================================================
--- doc/help/ref-cupsd-conf.html.in (revision 10288)
+++ doc/help/ref-cupsd-conf.html.in (working copy)
@@ -1675,7 +1675,22 @@
+
+Examples
+
+
+MaxHoldTime 10800
+MaxHoldTime 0
+
+
+Description
+
+The MaxHoldTime
directive controls the maximum number of seconds allowed for a job to remain in the "indefinite" hold state. The job is canceled automatically if it remains held indefinitely longer than the specified number of seconds.
+
+The default setting is 0 which disables this functionality.
+
+
Examples
Index: man/cupsd.conf.man.in
===================================================================
--- man/cupsd.conf.man.in (revision 10288)
+++ man/cupsd.conf.man.in (working copy)
@@ -12,7 +12,7 @@
.\" which should have been included with this file. If this file is
.\" file is missing or damaged, see the license at "http://www.cups.org/".
.\"
-.TH cupsd.conf 5 "CUPS" "6 January 2012" "Apple Inc."
+.TH cupsd.conf 5 "CUPS" "15 February 2012" "Apple Inc."
.SH NAME
cupsd.conf \- server configuration file for cups
.SH DESCRIPTION
@@ -386,6 +386,11 @@
.br
Specifies the maximum number of copies that a user can print of each job.
.TP 5
+MaxHoldTime seconds
+.br
+Specifies the maximum time a job may remain in the "indefinite" hold state
+before it is canceled. Set to 0 to disable cancellation of held jobs.
+.TP 5
MaxJobs number
.br
Specifies the maximum number of simultaneous jobs to support.
@@ -634,7 +639,7 @@
.br
http://localhost:631/help
.SH COPYRIGHT
-Copyright 2007-2011 by Apple Inc.
+Copyright 2007-2012 by Apple Inc.
.\"
.\" End of "$Id$".
.\"
Index: scheduler/conf.c
===================================================================
--- scheduler/conf.c (revision 10288)
+++ scheduler/conf.c (working copy)
@@ -3,7 +3,7 @@
*
* Configuration routines for the CUPS scheduler.
*
- * Copyright 2007-2011 by Apple Inc.
+ * Copyright 2007-2012 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
@@ -132,6 +132,7 @@
{ "MaxClientsPerHost", &MaxClientsPerHost, CUPSD_VARTYPE_INTEGER },
{ "MaxCopies", &MaxCopies, CUPSD_VARTYPE_INTEGER },
{ "MaxEvents", &MaxEvents, CUPSD_VARTYPE_INTEGER },
+ { "MaxHoldTime", &MaxHoldTime, CUPSD_VARTYPE_INTEGER },
{ "MaxJobs", &MaxJobs, CUPSD_VARTYPE_INTEGER },
{ "MaxJobsPerPrinter", &MaxJobsPerPrinter, CUPSD_VARTYPE_INTEGER },
{ "MaxJobsPerUser", &MaxJobsPerUser, CUPSD_VARTYPE_INTEGER },
@@ -743,6 +744,7 @@
JobHistory = DEFAULT_HISTORY;
JobFiles = DEFAULT_FILES;
JobAutoPurge = 0;
+ MaxHoldTime = 0;
MaxJobs = 500;
MaxActiveJobs = 0;
MaxJobsPerUser = 0;
Index: scheduler/job.c
===================================================================
--- scheduler/job.c (revision 10299)
+++ scheduler/job.c (working copy)
@@ -2247,6 +2247,8 @@
* Update the hold time...
*/
+ job->cancel_time = 0;
+
if (!strcmp(when, "indefinite") || !strcmp(when, "auth-info-required"))
{
/*
@@ -2254,6 +2256,9 @@
*/
job->hold_until = 0;
+
+ if (MaxHoldTime > 0)
+ job->cancel_time = time(NULL) + MaxHoldTime;
}
else if (!strcmp(when, "day-time"))
{
Index: scheduler/job.h
===================================================================
--- scheduler/job.h (revision 10288)
+++ scheduler/job.h (working copy)
@@ -99,6 +99,8 @@
/* Max number of jobs */
MaxActiveJobs VALUE(0),
/* Max number of active jobs */
+ MaxHoldTime VALUE(0),
+ /* Max time for indefinite hold */
MaxJobsPerUser VALUE(0),
/* Max jobs per user */
MaxJobsPerPrinter VALUE(0),