pdancak / rpms / cups

Forked from rpms/cups 2 years ago
Clone
f40e662
diff -up cups-1.5.4/backend/ipp.c.str4190 cups-1.5.4/backend/ipp.c
f40e662
--- cups-1.5.4/backend/ipp.c.str4190	2012-11-05 17:18:56.265644206 +0000
f40e662
+++ cups-1.5.4/backend/ipp.c	2012-11-05 17:19:23.948745897 +0000
f40e662
@@ -1305,6 +1305,16 @@ main(int  argc,				/* I - Number of comm
f40e662
   }
f40e662
 
f40e662
  /*
f40e662
+  * If the printer only claims to support IPP/1.0, or if the user specifically
f40e662
+  * included version=1.0 in the URI, then do not try to use Create-Job or
f40e662
+  * Send-Document.  This is another dreaded compatibility hack, but unfortunately
f40e662
+  * there are enough broken printers out there that we need this for now...
f40e662
+  */
f40e662
+
f40e662
+  if (version == 10)
f40e662
+    create_job = send_document = 0;
f40e662
+
f40e662
+ /*
f40e662
   * Start monitoring the printer in the background...
f40e662
   */
f40e662
 
f40e662
@@ -1520,10 +1530,9 @@ main(int  argc,				/* I - Number of comm
f40e662
 	  goto cleanup;
f40e662
 	}
f40e662
       }
f40e662
-      else if (ipp_status == IPP_ERROR_JOB_CANCELED)
f40e662
+      else if (ipp_status == IPP_ERROR_JOB_CANCELED ||
f40e662
+               ipp_status == IPP_NOT_AUTHORIZED)
f40e662
         goto cleanup;
f40e662
-      else if (ipp_status == IPP_NOT_AUTHORIZED)
f40e662
-        continue;
f40e662
       else
f40e662
       {
f40e662
        /*
f40e662
@@ -1709,14 +1718,35 @@ main(int  argc,				/* I - Number of comm
f40e662
              ipp_status == IPP_NOT_POSSIBLE ||
f40e662
 	     ipp_status == IPP_PRINTER_BUSY)
f40e662
       continue;
f40e662
-    else if (ipp_status == IPP_REQUEST_VALUE)
f40e662
+    else if (ipp_status == IPP_REQUEST_VALUE ||
f40e662
+             ipp_status == IPP_ERROR_JOB_CANCELED ||
f40e662
+             ipp_status == IPP_NOT_AUTHORIZED)
f40e662
     {
f40e662
      /*
f40e662
-      * Print file is too large, abort this job...
f40e662
+      * Print file is too large, job was canceled, or we need new
f40e662
+      * authentication data...
f40e662
       */
f40e662
 
f40e662
       goto cleanup;
f40e662
     }
f40e662
+    else if (ipp_status == IPP_NOT_FOUND)
f40e662
+    {
f40e662
+     /*
f40e662
+      * Printer does not actually implement support for Create-Job/
f40e662
+      * Send-Document, so log the conformance issue and stop the printer.
f40e662
+      */
f40e662
+
f40e662
+      fputs("DEBUG: This printer claims to support Create-Job and "
f40e662
+            "Send-Document, but those operations failed.\n", stderr);
f40e662
+      fputs("DEBUG: Add '?version=1.0' to the device URI to use legacy "
f40e662
+            "compatibility mode.\n", stderr);
f40e662
+      update_reasons(NULL, "+cups-ipp-conformance-failure-report,"
f40e662
+			   "cups-ipp-missing-send-document");
f40e662
+
f40e662
+      ipp_status = IPP_INTERNAL_ERROR;	/* Force queue to stop */
f40e662
+
f40e662
+      goto cleanup;
f40e662
+    }
f40e662
     else
f40e662
       copies_remaining --;
f40e662