]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - scheduler/job.c
Merge changes from CUPS 1.4svn-r7874.
[thirdparty/cups.git] / scheduler / job.c
index 0669ec028a33cc42f35b15e31a066c2e212865d6..e2d74c6329e22191daceb31b0327e65b19996248 100644 (file)
@@ -373,8 +373,9 @@ cupsdCheckJobs(void)
     */
 
     cupsdLogMessage(CUPSD_LOG_DEBUG2,
-                    "cupsdCheckJobs: Job %d: state_value=%d, loaded=%s",
-                    job->id, job->state_value, job->attrs ? "yes" : "no");
+                    "cupsdCheckJobs: Job %d: dest=%s, dtype=%x, "
+                   "state_value=%d, loaded=%s", job->id, job->dest, job->dtype,
+                   job->state_value, job->attrs ? "yes" : "no");
 
     if (job->state_value == IPP_JOB_HELD &&
         job->hold_until &&
@@ -658,11 +659,13 @@ cupsdFinishJob(cupsd_job_t *job)  /* I - Job */
          cupsdMarkDirty(CUPSD_DIRTY_JOBS);
 
         /*
-         * If the job was queued to a class, try requeuing it...  For
-         * faxes and retry-job queues, hold the current job for 5 minutes.
+         * If the job was queued to a class or the error policy is
+         * "retry-current-job", try requeuing it...  For faxes and retry-job
+         * queues, hold the current job for 5 minutes.
          */
 
-         if (job->dtype & (CUPS_PRINTER_CLASS | CUPS_PRINTER_IMPLICIT))
+         if ((job->dtype & (CUPS_PRINTER_CLASS | CUPS_PRINTER_IMPLICIT)) ||
+             !strcmp(printer->error_policy, "retry-current-job"))
            cupsdCheckJobs();
          else if ((printer->type & CUPS_PRINTER_FAX) ||
                   !strcmp(printer->error_policy, "retry-job"))
@@ -955,8 +958,6 @@ cupsdHoldJob(cupsd_job_t *job)              /* I - Job data */
 
   job->dirty = 1;
   cupsdMarkDirty(CUPSD_DIRTY_JOBS);
-
-  cupsdCheckJobs();
 }
 
 
@@ -1380,13 +1381,19 @@ cupsdReleaseJob(cupsd_job_t *job)       /* I - Job */
 
   if (job->state_value == IPP_JOB_HELD)
   {
+   /*
+    * Add trailing banner as needed...
+    */
+
+    if (job->pending_timeout)
+      cupsdTimeoutJob(job);
+
     DEBUG_puts("cupsdReleaseJob: setting state to pending...");
 
     job->state->values[0].integer = IPP_JOB_PENDING;
     job->state_value              = IPP_JOB_PENDING;
     job->dirty = 1;
     cupsdMarkDirty(CUPSD_DIRTY_JOBS);
-    cupsdCheckJobs();
   }
 }
 
@@ -1418,8 +1425,6 @@ cupsdRestartJob(cupsd_job_t *job) /* I - Job */
 
     if (old_state > IPP_JOB_STOPPED)
       cupsArrayAdd(ActiveJobs, job);
-
-    cupsdCheckJobs();
   }
 }