From: Michael R Sweet Date: Thu, 21 Feb 2019 15:43:16 +0000 (-0500) Subject: Don't stop a printer after a job is canceled/aborted (Issue #5517) X-Git-Tag: v2.3b8~103 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=45cae1bc04117750d9a8b4722c257eeebc784cc7;p=thirdparty%2Fcups.git Don't stop a printer after a job is canceled/aborted (Issue #5517) --- diff --git a/CHANGES.md b/CHANGES.md index 8c7e3687b7..6e43dbb4f9 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -23,6 +23,8 @@ Changes in CUPS v2.3b8 - The web interface no longer provides access to the log files (Issue #5513) - Non-Kerberized printing to Windows via IPP was broken (Issue #5515) - Eliminated use of private headers and some deprecated macOS APIs (Issue #5516) +- The scheduler no longer stops a printer if an error occurs when a job is + canceled or aborted (Issue #5517) - Added a USB quirks rule for the DYMO 450 Turbo (Issue #5521) - Added a USB quirks rule for Xerox printers (Issue #5523) - The scheduler's self-signed certificate did not include all of the alternate diff --git a/backend/ipp.c b/backend/ipp.c index e91f7684c2..0b2edeb7ef 100644 --- a/backend/ipp.c +++ b/backend/ipp.c @@ -2232,8 +2232,9 @@ main(int argc, /* I - Number of command-line args */ else if (ipp_status == IPP_STATUS_ERROR_CUPS_ACCOUNT_AUTHORIZATION_FAILED) fputs("JOBSTATE: account-authorization-failed\n", stderr); - if (ipp_status == IPP_STATUS_ERROR_NOT_AUTHORIZED || ipp_status == IPP_STATUS_ERROR_FORBIDDEN || - ipp_status == IPP_STATUS_ERROR_CUPS_AUTHENTICATION_CANCELED) + if (job_canceled) + return (CUPS_BACKEND_OK); + else if (ipp_status == IPP_STATUS_ERROR_NOT_AUTHORIZED || ipp_status == IPP_STATUS_ERROR_FORBIDDEN || ipp_status == IPP_STATUS_ERROR_CUPS_AUTHENTICATION_CANCELED) return (CUPS_BACKEND_AUTH_REQUIRED); else if (ipp_status == IPP_STATUS_ERROR_CUPS_ACCOUNT_LIMIT_REACHED || ipp_status == IPP_STATUS_ERROR_CUPS_ACCOUNT_INFO_NEEDED || diff --git a/scheduler/job.c b/scheduler/job.c index da7cb9c086..d924b2eb52 100644 --- a/scheduler/job.c +++ b/scheduler/job.c @@ -1,7 +1,7 @@ /* * Job management routines for the CUPS scheduler. * - * Copyright © 2007-2018 by Apple Inc. + * Copyright © 2007-2019 by Apple Inc. * Copyright © 1997-2007 by Easy Software Products, all rights reserved. * * Licensed under Apache License v2.0. See the file "LICENSE" for more @@ -3437,6 +3437,12 @@ finalize_job(cupsd_job_t *job, /* I - Job */ * Stop the printer... */ + if (job_state == IPP_JSTATE_CANCELED || job_state == IPP_JSTATE_ABORTED) + { + cupsdLogJob(job, CUPSD_LOG_INFO, "Ignored STOP from backend since the job is %s.", job_state == IPP_JSTATE_CANCELED ? "canceled" : "aborted"); + break; + } + printer_state = IPP_PRINTER_STOPPED; if (ErrorLog) @@ -3451,8 +3457,7 @@ finalize_job(cupsd_job_t *job, /* I - Job */ { job_state = IPP_JOB_PENDING; - ippSetString(job->attrs, &job->reasons, 0, - "resources-are-not-ready"); + ippSetString(job->attrs, &job->reasons, 0, "resources-are-not-ready"); } break;