]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
The IPP backend did not always handle jobs getting canceled at the printer
authormsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>
Fri, 9 Oct 2015 13:15:16 +0000 (13:15 +0000)
committermsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>
Fri, 9 Oct 2015 13:15:16 +0000 (13:15 +0000)
(<rdar://problem/22716820>)

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

CHANGES-2.1.txt
backend/ipp.c
doc/help/man-cups-lpd.html
doc/help/man-cups-snmp.html
doc/help/man-cupsaddsmb.html
doc/help/man-cupsd.html
doc/help/man-lpoptions.html

index 89bccfcd9452dfee7e6d51bc769817466f458713..7ba00211e94404ca73ccbbdec6846aca4438d588 100644 (file)
@@ -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 (<rdar://problem/22716820>)
        - Updated localizations (STR #4709)
 
 
index 1f7e82b452b538294226ab80567e82c97555598e..2376da4e77424eb31575951e34effba0a8f96425 100644 (file)
@@ -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;
index 697518ac0eda7d5f05df8d2eb6828f69f4dc3724..b4f1184e04148f7fc66e2b13d7cc406075c17a82 100644 (file)
@@ -108,7 +108,7 @@ service using the corresponding control program.
 CUPS Online Help (<a href="http://localhost:631/help)">http://localhost:631/help)</a>,
 RFC 2569
 <h2 class="title"><a name="COPYRIGHT">Copyright</a></h2>
-Copyright &copy; 2007-2015 by Apple Inc.
+Copyright &copy; 2007-2014 by Apple Inc.
 
 </body>
 </html>
index faa57639dcd5c0a862cfc1edd79951d05e0fcc00..06a48133fff7ad7c208abdce8b061774a72f35fd 100644 (file)
@@ -48,7 +48,7 @@ The CUPS SNMP backend uses the information from the Host, Printer, and Port Moni
 <a href="man-lpinfo.html?TOPIC=Man+Pages"><b>lpinfo</b>(8),</a>
 CUPS Online Help (<a href="http://localhost:631/help">http://localhost:631/help</a>)
 <h2 class="title"><a name="COPYRIGHT">Copyright</a></h2>
-Copyright &copy; 2007-2015 by Apple Inc.
+Copyright &copy; 2007-2014 by Apple Inc.
 
 </body>
 </html>
index cb2901e2761c57135d529d8c44740ad260b0ec29..622d30a7d2ea8e177b9e024a0212708ddf7a541c 100644 (file)
@@ -115,7 +115,7 @@ This is useful for debugging SAMBA configuration problems.
 <b>smb.conf</b>(5),
 CUPS Online Help (<a href="http://localhost:631/help">http://localhost:631/help</a>)
 <h2 class="title"><a name="COPYRIGHT">Copyright</a></h2>
-Copyright &copy; 2007-2015 by Apple Inc.
+Copyright &copy; 2007-2014 by Apple Inc.
 
 </body>
 </html>
index de1294217030b249649f0f7d628fd855be815ebd..8f90f447c43057876f58865bbc48051979f3e0b8 100644 (file)
@@ -14,7 +14,7 @@ cupsd - cups scheduler
 [
 <b>-c</b>
 <i>config-file</i>
-] [
+] [ 
 <b>-f</b>
 ] [
 <b>-F</b>
@@ -111,7 +111,7 @@ in the foreground with a test configuration file called
 <b>systemd</b>(8),
 CUPS Online Help (<a href="http://localhost:631/help">http://localhost:631/help</a>)
 <h2 class="title"><a name="COPYRIGHT">Copyright</a></h2>
-Copyright &copy; 2007-2015 by Apple Inc.
+Copyright &copy; 2007-2014 by Apple Inc.
 
 </body>
 </html>
index 0aeed451da103343e6f76de69b48d01c9bdcabdc..2e171296b5da1ee3e39e265c4f0f623be512b7b1 100644 (file)
@@ -119,7 +119,7 @@ The <b>lpoptions</b> command is unique to CUPS.
 <a href="man-lprm.html?TOPIC=Man+Pages"><b>lprm</b>(1),</a>
 CUPS Online Help (<a href="http://localhost:631/help">http://localhost:631/help</a>)
 <h2 class="title"><a name="COPYRIGHT">Copyright</a></h2>
-Copyright &copy; 2007-2015 by Apple Inc.
+Copyright &copy; 2007-2014 by Apple Inc.
 
 </body>
 </html>