From: msweet Date: Fri, 9 Oct 2015 13:15:16 +0000 (+0000) Subject: The IPP backend did not always handle jobs getting canceled at the printer X-Git-Tag: v2.2b1~184 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f024f448c0e9d153b35cb6e139840b0bac1549f0;p=thirdparty%2Fcups.git The IPP backend did not always handle jobs getting canceled at the printer () git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@12895 a1ca3aef-8c08-0410-bb20-df032aa958be --- diff --git a/CHANGES-2.1.txt b/CHANGES-2.1.txt index 89bccfcd94..7ba00211e9 100644 --- a/CHANGES-2.1.txt +++ b/CHANGES-2.1.txt @@ -11,6 +11,8 @@ CHANGES IN CUPS V2.1.1 (STR #4707) - Current Primera printers were incorrectly reported as Fargo printers (STR #4708) + - The IPP backend did not always handle jobs getting canceled at the + printer () - Updated localizations (STR #4709) diff --git a/backend/ipp.c b/backend/ipp.c index 1f7e82b452..2376da4e77 100644 --- a/backend/ipp.c +++ b/backend/ipp.c @@ -1800,7 +1800,7 @@ main(int argc, /* I - Number of command-line args */ fprintf(stderr, "DEBUG: Send-Document: %s (%s)\n", ippErrorString(cupsLastError()), cupsLastErrorString()); - if (cupsLastError() > IPP_OK_CONFLICT) + if (cupsLastError() > IPP_OK_CONFLICT && !job_canceled) { ipp_status = cupsLastError(); @@ -1818,6 +1818,9 @@ main(int argc, /* I - Number of command-line args */ } } + if (job_canceled) + break; + if (ipp_status <= IPP_OK_CONFLICT && argc > 6) { fprintf(stderr, "PAGE: 1 %d\n", copies_sup ? atoi(argv[4]) : 1); @@ -2444,6 +2447,17 @@ monitor_printer( } } + fprintf(stderr, "DEBUG: (monitor) job-state = %s\n", + ippEnumString("job-state", monitor->job_state)); + + if (!job_canceled && + (monitor->job_state == IPP_JOB_CANCELED || + monitor->job_state == IPP_JOB_ABORTED)) + { + job_canceled = -1; + fprintf(stderr, "DEBUG: (monitor) job_canceled = -1\n"); + } + if ((attr = ippFindAttribute(response, "job-state-reasons", IPP_TAG_KEYWORD)) != NULL) { @@ -2465,7 +2479,8 @@ monitor_printer( new_reasons |= _CUPS_JSR_JOB_PASSWORD_WAIT; else if (!strcmp(attr->values[i].string.text, "job-release-wait")) new_reasons |= _CUPS_JSR_JOB_RELEASE_WAIT; - else if (!strncmp(attr->values[i].string.text, "job-canceled-", 13) || !strcmp(attr->values[i].string.text, "aborted-by-system")) + if (!job_canceled && + (!strncmp(attr->values[i].string.text, "job-canceled-", 13) || !strcmp(attr->values[i].string.text, "aborted-by-system"))) job_canceled = 1; } @@ -2492,7 +2507,7 @@ monitor_printer( ippDelete(response); - fprintf(stderr, "DEBUG: (monitor) job-state=%s\n", + fprintf(stderr, "DEBUG: (monitor) job-state = %s\n", ippEnumString("job-state", monitor->job_state)); if (!job_canceled && @@ -2530,7 +2545,10 @@ monitor_printer( monitor->user, monitor->version); if (cupsLastError() > IPP_OK_CONFLICT) + { + fprintf(stderr, "DEBUG: (monitor) cancel_job() = %s\n", cupsLastErrorString()); _cupsLangPrintFilter(stderr, "ERROR", _("Unable to cancel print job.")); + } } } @@ -3258,7 +3276,7 @@ sigterm_handler(int sig) /* I - Signal */ * Flag that the job should be canceled... */ - write(2, "DEBUG: job_canceled = 1.\n", 25); + write(2, "DEBUG: sigterm_handler: job_canceled = 1.\n", 25); job_canceled = 1; return; diff --git a/doc/help/man-cups-lpd.html b/doc/help/man-cups-lpd.html index 697518ac0e..b4f1184e04 100644 --- a/doc/help/man-cups-lpd.html +++ b/doc/help/man-cups-lpd.html @@ -108,7 +108,7 @@ service using the corresponding control program. CUPS Online Help (http://localhost:631/help), RFC 2569

Copyright

-Copyright © 2007-2015 by Apple Inc. +Copyright © 2007-2014 by Apple Inc. diff --git a/doc/help/man-cups-snmp.html b/doc/help/man-cups-snmp.html index faa57639dc..06a48133ff 100644 --- a/doc/help/man-cups-snmp.html +++ b/doc/help/man-cups-snmp.html @@ -48,7 +48,7 @@ The CUPS SNMP backend uses the information from the Host, Printer, and Port Moni lpinfo(8), CUPS Online Help (http://localhost:631/help)

Copyright

-Copyright © 2007-2015 by Apple Inc. +Copyright © 2007-2014 by Apple Inc. diff --git a/doc/help/man-cupsaddsmb.html b/doc/help/man-cupsaddsmb.html index cb2901e276..622d30a7d2 100644 --- a/doc/help/man-cupsaddsmb.html +++ b/doc/help/man-cupsaddsmb.html @@ -115,7 +115,7 @@ This is useful for debugging SAMBA configuration problems. smb.conf(5), CUPS Online Help (http://localhost:631/help)

Copyright

-Copyright © 2007-2015 by Apple Inc. +Copyright © 2007-2014 by Apple Inc. diff --git a/doc/help/man-cupsd.html b/doc/help/man-cupsd.html index de12942170..8f90f447c4 100644 --- a/doc/help/man-cupsd.html +++ b/doc/help/man-cupsd.html @@ -14,7 +14,7 @@ cupsd - cups scheduler [ -c config-file -] [ +] [ -f ] [ -F @@ -111,7 +111,7 @@ in the foreground with a test configuration file called systemd(8), CUPS Online Help (http://localhost:631/help)

Copyright

-Copyright © 2007-2015 by Apple Inc. +Copyright © 2007-2014 by Apple Inc. diff --git a/doc/help/man-lpoptions.html b/doc/help/man-lpoptions.html index 0aeed451da..2e171296b5 100644 --- a/doc/help/man-lpoptions.html +++ b/doc/help/man-lpoptions.html @@ -119,7 +119,7 @@ The lpoptions command is unique to CUPS. lprm(1), CUPS Online Help (http://localhost:631/help)

Copyright

-Copyright © 2007-2015 by Apple Inc. +Copyright © 2007-2014 by Apple Inc.