]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
<rdar://problem/13655599> Seed: Print queue JOBS disappear after computer Wakes up...
authormsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>
Wed, 11 Sep 2013 17:55:16 +0000 (17:55 +0000)
committermsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>
Wed, 11 Sep 2013 17:55:16 +0000 (17:55 +0000)
Need to provide -default and -supported attributes, map job-cancel-after-xxx
to integer.

git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@11282 a1ca3aef-8c08-0410-bb20-df032aa958be

cups/encode.c
scheduler/printers.c

index 667e0d3041c6e6a2e0477ccae6f3b78dc8feb776..9b9efe1fd644f32badde7847c0bc1686fcecaeab 100644 (file)
@@ -176,6 +176,8 @@ static const _ipp_option_t ipp_options[] =
   { 0, "job-accounting-user-id", IPP_TAG_NAME,          IPP_TAG_JOB },
   { 0, "job-accounting-user-id-default", IPP_TAG_NAME,  IPP_TAG_PRINTER },
   { 0, "job-authorization-uri",        IPP_TAG_URI,            IPP_TAG_OPERATION },
+  { 0, "job-cancel-after",     IPP_TAG_INTEGER,        IPP_TAG_JOB },
+  { 0, "job-cancel-after-default", IPP_TAG_INTEGER,    IPP_TAG_PRINTER },
   { 0, "job-hold-until",       IPP_TAG_KEYWORD,        IPP_TAG_JOB },
   { 0, "job-id",               IPP_TAG_INTEGER,        IPP_TAG_ZERO }, /* never send as option */
   { 0, "job-impressions",      IPP_TAG_INTEGER,        IPP_TAG_ZERO }, /* never send as option */
index 540b536c5af2293ba63cdb5e4ea284e604e23af7..4a7d96876a0bacff7b0f16a2caa0173ff6aa98b9 100644 (file)
@@ -3,7 +3,7 @@
  *
  *   Printer routines for the CUPS scheduler.
  *
- *   Copyright 2007-2012 by Apple Inc.
+ *   Copyright 2007-2013 by Apple Inc.
  *   Copyright 1997-2007 by Easy Software Products, all rights reserved.
  *
  *   These coded instructions, statements, and computer programs are the
@@ -470,6 +470,10 @@ cupsdCreateCommonData(void)
   ippAddInteger(CommonData, IPP_TAG_PRINTER, IPP_TAG_INTEGER,
                 "ippget-event-life", 15);
 
+  /* job-cancel-after-supported */
+  ippAddRange(CommonData, IPP_TAG_PRINTER, "job-cancel-after-supported",
+              0, INT_MAX);
+
   /* job-creation-attributes-supported */
   ippAddStrings(CommonData, IPP_TAG_PRINTER, IPP_TAG_KEYWORD | IPP_TAG_COPY,
                 "job-creation-attributes-supported",
@@ -3162,6 +3166,7 @@ add_printer_defaults(cupsd_printer_t *p)/* I - Printer */
     cupsArrayAdd(CommonDefaults, _cupsStrAlloc("job-account-id-default"));
     cupsArrayAdd(CommonDefaults,
                  _cupsStrAlloc("job-accounting-user-id-default"));
+    cupsArrayAdd(CommonDefaults, _cupsStrAlloc("job-cancel-after-default"));
     cupsArrayAdd(CommonDefaults, _cupsStrAlloc("job-hold-until-default"));
     cupsArrayAdd(CommonDefaults, _cupsStrAlloc("job-priority-default"));
     cupsArrayAdd(CommonDefaults, _cupsStrAlloc("job-sheets-default"));
@@ -3210,6 +3215,10 @@ add_printer_defaults(cupsd_printer_t *p)/* I - Printer */
     ippAddString(p->attrs, IPP_TAG_PRINTER, IPP_TAG_MIMETYPE,
                 "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,
+                 "job-cancel-after-default", MaxJobTime);
+
   if (!cupsGetOption("job-hold-until", p->num_options, p->options))
     ippAddString(p->attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD,
                  "job-hold-until-default", NULL, "no-hold");