]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Retry Validate-Job once, if needed (Issue #132)
authorMichael R Sweet <michael.r.sweet@gmail.com>
Fri, 9 Apr 2021 14:20:04 +0000 (10:20 -0400)
committerMichael R Sweet <michael.r.sweet@gmail.com>
Fri, 9 Apr 2021 14:20:04 +0000 (10:20 -0400)
CHANGES.md
backend/ipp.c

index e8ce786c98c41a1b5ddf2357de67f601f17e3d8e..d668fba6e51c2a66c6098b4b14eb4c8067432c6b 100644 (file)
@@ -33,6 +33,7 @@ CUPS v2.4rc1 (Pending)
   negotiation failed (Apple #5907)
 - `httpUpdate` did not reset the socket file descriptor when the TLS
   negotiation failed (Apple #5915)
+- The IPP backend now retries Validate-Job requests (Issue #132)
 - Documentation fixes (Issue #92, Issue #163)
 - Localization updates (Issue #123, Issue #129, Issue #134, Issue #146,
   Issue #164)
index 63353a66df48f6ae6075a0617286222134079204..020ab7fd4ae8eaf862b5c229e1822227d6e59cf9 100644 (file)
@@ -1,7 +1,8 @@
 /*
  * IPP backend for CUPS.
  *
- * Copyright © 2007-2019 by Apple Inc.
+ * Copyright © 2021 by OpenPrinting
+ * Copyright © 2007-2021 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
@@ -256,6 +257,7 @@ main(int  argc,                             /* I - Number of command-line args */
                get_job_attrs = 0,      /* Does printer support Get-Job-Attributes? */
                send_document = 0,      /* Does printer support Send-Document? */
                validate_job = 0,       /* Does printer support Validate-Job? */
+               validate_retried = 0,   /* Was Validate-Job request retried? */
                copies,                 /* Number of copies for job */
                copies_remaining;       /* Number of copies remaining */
   const char   *content_type,          /* CONTENT_TYPE environment variable */
@@ -1559,7 +1561,17 @@ main(int  argc,                          /* I - Number of command-line args */
              ipp_status == IPP_STATUS_ERROR_BAD_REQUEST)
       break;
     else if (job_auth == NULL && ipp_status > IPP_STATUS_ERROR_BAD_REQUEST)
+    {
+      if (!validate_retried)
+      {
+        // Retry Validate-Job operation once, to work around known printer bug...
+        validate_retried = 1;
+        sleep(10);
+        continue;
+      }
+
       goto cleanup;
+    }
   }
 
  /*