Index: doc/help/ref-classes-conf.html
===================================================================
--- doc/help/ref-classes-conf.html (revision 8575)
+++ doc/help/ref-classes-conf.html (working copy)
@@ -155,52 +155,6 @@
HREF="#AllowUser">AllowUser
-
-
-Examples
-
-
-<Class name>
- ...
- ErrorPolicy abort-job
-</Class>
-
-
-Description
-
-The ErrorPolicy
directive defines the policy that
-is used when a backend is unable to send a print job to the
-printer. The lpadmin(8)
command sets the current
-error policy:
-
-
-/usr/sbin/lpadmin -p classname -o printer-error-policy=stop-printer
-
-
-The following values are supported:
-
-
-
- abort-job
- Abort the job and proceed
- with the next job in the queue
-
- retry-job
- Retry the job after waiting
- for N seconds; the cupsd.conf JobRetryInterval
- directive controls the value of N
-
- stop-printer
- Stop the printer and keep
- the job for future printing; this is the default
- value
-
-
-
-This directive must appear inside a Class
or DefaultClass
-section.
-
-
Examples
Index: man/classes.conf.man
===================================================================
--- man/classes.conf.man (revision 8575)
+++ man/classes.conf.man (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 classes.conf 5 "CUPS" "12 February 2006" "Apple Inc."
+.TH classes.conf 5 "CUPS" "29 April 2009" "Apple Inc."
.SH NAME
classes.conf \- class configuration file for cups
.SH DESCRIPTION
@@ -47,14 +47,6 @@
.br
Prevents specific users and groups from printing to the printer.
.TP 5
-ErrorPolicy abort-job
-.TP 5
-ErrorPolicy retry-job
-.TP 5
-ErrorPolicy stop-printer
-.br
-Specifies the error policy for the printer.
-.TP 5
Info text
.br
Specifies human-readable text describing the printer.
Index: man/printers.conf.man
===================================================================
--- man/printers.conf.man (revision 8575)
+++ man/printers.conf.man (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 printers.conf 5 "CUPS" "12 February 2006" "Apple Inc."
+.TH printers.conf 5 "CUPS" "29 April 2009" "Apple Inc."
.SH NAME
printers.conf \- printer configuration file for cups
.SH DESCRIPTION
@@ -53,6 +53,8 @@
.TP 5
ErrorPolicy abort-job
.TP 5
+ErrorPolicy retry-current-job
+.TP 5
ErrorPolicy retry-job
.TP 5
ErrorPolicy stop-printer
Index: scheduler/ipp.c
===================================================================
--- scheduler/ipp.c (revision 8575)
+++ scheduler/ipp.c (working copy)
@@ -5496,6 +5496,25 @@
ippAddString(con->response, IPP_TAG_PRINTER, IPP_TAG_NAME,
"printer-error-policy", NULL, printer->error_policy);
+ if (!ra || cupsArrayFind(ra, "printer-error-policy-supported"))
+ {
+ static const char * const errors[] =/* printer-error-policy-supported values */
+ {
+ "abort-job",
+ "retry-current-job",
+ "retry-job",
+ "stop-printer"
+ };
+
+ if (printer->type & (CUPS_PRINTER_IMPLICIT | CUPS_PRINTER_CLASS))
+ ippAddString(con->response, IPP_TAG_PRINTER, IPP_TAG_NAME | IPP_TAG_COPY,
+ "printer-error-policy-supported", NULL, "retry-current-job");
+ else
+ ippAddStrings(con->response, IPP_TAG_PRINTER, IPP_TAG_NAME | IPP_TAG_COPY,
+ "printer-error-policy-supported",
+ sizeof(errors) / sizeof(errors[0]), NULL, errors);
+ }
+
if (!ra || cupsArrayFind(ra, "printer-is-accepting-jobs"))
ippAddBoolean(con->response, IPP_TAG_PRINTER, "printer-is-accepting-jobs",
printer->accepting);
@@ -10821,10 +10840,11 @@
if (attr->value_tag != IPP_TAG_NAME && attr->value_tag != IPP_TAG_KEYWORD)
continue;
- if (strcmp(attr->values[0].string.text, "abort-job") &&
- strcmp(attr->values[0].string.text, "retry-current-job") &&
- strcmp(attr->values[0].string.text, "retry-job") &&
- strcmp(attr->values[0].string.text, "stop-printer"))
+ if (strcmp(attr->values[0].string.text, "retry-current-job") &&
+ ((printer->type & (CUPS_PRINTER_IMPLICIT | CUPS_PRINTER_CLASS)) ||
+ (strcmp(attr->values[0].string.text, "abort-job") &&
+ strcmp(attr->values[0].string.text, "retry-job") &&
+ strcmp(attr->values[0].string.text, "stop-printer"))))
{
send_ipp_status(con, IPP_NOT_POSSIBLE,
_("Unknown printer-error-policy \"%s\"."),
Index: scheduler/printers.c
===================================================================
--- scheduler/printers.c (revision 8575)
+++ scheduler/printers.c (working copy)
@@ -371,13 +371,6 @@
"separate-documents-uncollated-copies",
"separate-documents-collated-copies"
};
- static const char * const errors[] = /* printer-error-policy-supported values */
- {
- "abort-job",
- "retry-current-job",
- "retry-job",
- "stop-printer"
- };
static const char * const notify_attrs[] =
{ /* notify-attributes-supported values */
"printer-state-change-time",
@@ -622,11 +615,6 @@
ippAddString(CommonData, IPP_TAG_PRINTER, IPP_TAG_KEYWORD | IPP_TAG_COPY,
"pdl-override-supported", NULL, "not-attempted");
- /* printer-error-policy-supported */
- ippAddStrings(CommonData, IPP_TAG_PRINTER, IPP_TAG_NAME | IPP_TAG_COPY,
- "printer-error-policy-supported",
- sizeof(errors) / sizeof(errors[0]), NULL, errors);
-
/* printer-op-policy-supported */
attr = ippAddStrings(CommonData, IPP_TAG_PRINTER, IPP_TAG_NAME | IPP_TAG_COPY,
"printer-op-policy-supported", cupsArrayCount(Policies),
Index: scheduler/classes.c
===================================================================
--- scheduler/classes.c (revision 8575)
+++ scheduler/classes.c (working copy)
@@ -57,7 +57,7 @@
cupsdSetStringf(&c->uri, "ipp://%s:%d/classes/%s", ServerName, RemotePort,
name);
- cupsdSetString(&c->error_policy, "retry-job");
+ cupsdSetString(&c->error_policy, "retry-current-job");
}
return (c);
@@ -629,7 +629,12 @@
else if (!strcasecmp(line, "ErrorPolicy"))
{
if (value)
- cupsdSetString(&p->error_policy, value);
+ {
+ if (strcmp(value, "retry-current-job") && strcmp(value, "retry-job"))
+ cupsdLogMessage(CUPSD_LOG_WARN,
+ "ErrorPolicy %s ignored on line %d of classes.conf",
+ value, linenum);
+ }
else
cupsdLogMessage(CUPSD_LOG_ERROR,
"Syntax error on line %d of classes.conf.", linenum);