9db046f
From 997514f0f7eb360d55a0e77fdba916221a395cb0 Mon Sep 17 00:00:00 2001
9db046f
From: mike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
9db046f
Date: Thu, 13 Dec 2012 16:38:56 +0000
9db046f
Subject: [PATCH] The IPP backend now stops queues when the server
9db046f
 configuration prevents successful job submission (STR #4125)
9db046f
9db046f
git-svn-id: http://svn.easysw.com/public/cups/trunk@10758 7a7537e8-13f0-0310-91df-b6672ffda945
9db046f
diff --git a/backend/ipp.c b/backend/ipp.c
9db046f
index 05843ea..c61d6c8 100644
9db046f
--- a/backend/ipp.c
9db046f
+++ b/backend/ipp.c
9db046f
@@ -1354,8 +1354,9 @@ main(int  argc,				/* I - Number of command-line args */
9db046f
  /*
9db046f
   * If the printer only claims to support IPP/1.0, or if the user specifically
9db046f
   * included version=1.0 in the URI, then do not try to use Create-Job or
9db046f
-  * Send-Document.  This is another dreaded compatibility hack, but unfortunately
9db046f
-  * there are enough broken printers out there that we need this for now...
9db046f
+  * Send-Document.  This is another dreaded compatibility hack, but
9db046f
+  * unfortunately there are enough broken printers out there that we need
9db046f
+  * this for now...
9db046f
   */
9db046f
 
9db046f
   if (version == 10)
9db046f
@@ -1812,6 +1813,27 @@ main(int  argc,				/* I - Number of command-line args */
9db046f
 
9db046f
       goto cleanup;
9db046f
     }
9db046f
+    else if (ipp_status == IPP_UPGRADE_REQUIRED)
9db046f
+    {
9db046f
+     /*
9db046f
+      * Server is configured incorrectly; the policy for Create-Job and
9db046f
+      * Send-Document has to be the same (auth or no auth, encryption or
9db046f
+      * no encryption).  Force the queue to stop since printing will never
9db046f
+      * work.
9db046f
+      */
9db046f
+
9db046f
+      fputs("DEBUG: The server or printer is configured incorrectly.\n",
9db046f
+            stderr);
9db046f
+      fputs("DEBUG: The policy for Create-Job and Send-Document must have the "
9db046f
+            "same authentication and encryption requirements.\n", stderr);
9db046f
+
9db046f
+      ipp_status = IPP_INTERNAL_ERROR;
9db046f
+
9db046f
+      if (job_id > 0)
9db046f
+	cancel_job(http, uri, job_id, resource, argv[2], version);
9db046f
+
9db046f
+      goto cleanup;
9db046f
+    }
9db046f
     else if (ipp_status == IPP_NOT_FOUND)
9db046f
     {
9db046f
      /*
9db046f
-- 
9db046f
1.8.0.1
9db046f