From ebaac3df802d413eab9aba0569268ce0edd46cb4 Mon Sep 17 00:00:00 2001 From: msweet Date: Wed, 11 Sep 2013 17:55:16 +0000 Subject: [PATCH] Seed: Print queue JOBS disappear after computer Wakes up from Sleep. 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 | 2 ++ scheduler/printers.c | 11 ++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/cups/encode.c b/cups/encode.c index 667e0d304..9b9efe1fd 100644 --- a/cups/encode.c +++ b/cups/encode.c @@ -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 */ diff --git a/scheduler/printers.c b/scheduler/printers.c index 540b536c5..4a7d96876 100644 --- a/scheduler/printers.c +++ b/scheduler/printers.c @@ -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"); -- 2.39.5