]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
The "reprint job" option was not available for some canceled jobs (Issue #4915)
authorMichael Sweet <michael.r.sweet@gmail.com>
Tue, 28 Mar 2017 12:49:16 +0000 (08:49 -0400)
committerMichael Sweet <michael.r.sweet@gmail.com>
Tue, 28 Mar 2017 12:49:16 +0000 (08:49 -0400)
CHANGES.txt
scheduler/job.c

index 17985581c5ea55d0629d4866d10b753822290b97..a89be63655d235c539791aef0099f35f6c899b09 100644 (file)
@@ -1,4 +1,4 @@
-CHANGES.txt - 2.2.3 - 2017-03-14
+CHANGES.txt - 2.2.3 - 2017-03-28
 --------------------------------
 
 CHANGES IN CUPS V2.2.3
@@ -22,6 +22,8 @@ CHANGES IN CUPS V2.2.3
         - Fixed an error handling issue for the network backends (Issue #4979)
        - The default cupsd.conf file did not work on systems compiled without
          Kerberos support (Issue #4947)
+       - The "reprint job" option was not available for some canceled jobs
+         (Issue #4915)
        - Fixed some localization issues on macOS (<rdar://problem/27245567>)
 
 
index 1b12fe5a152826774544c93db180c94678e0b82b..78240155525eb5b9ae9e615b592f82ce3bc81e39 100644 (file)
@@ -456,6 +456,7 @@ cupsdCleanJobs(void)
       else if (job->file_time && job->file_time <= curtime)
       {
         cupsdLogJob(job, CUPSD_LOG_DEBUG, "Removing document files.");
+        cupsdLogJob(job, CUPSD_LOG_DEBUG2, "curtime=%ld, job->file_time=%ld", (long)curtime, (long)job->file_time);
         remove_job_files(job);
 
         cupsdMarkDirty(CUPSD_DIRTY_JOBS);
@@ -1743,6 +1744,8 @@ cupsdLoadJob(cupsd_job_t *job)            /* I - Job */
     else
       job->file_time = INT_MAX;
 
+    cupsdLogJob(job, CUPSD_LOG_DEBUG2, "cupsdLoadJob: job->file_time=%ld, time-at-completed=%ld, JobFiles=%d", (long)job->file_time, (long)attr->values[0].integer, JobFiles);
+
     if (job->file_time < JobHistoryUpdate || !JobHistoryUpdate)
       JobHistoryUpdate = job->file_time;
 
@@ -2742,7 +2745,7 @@ cupsdSetJobState(
          job->dirty = 1;
          cupsdMarkDirty(CUPSD_DIRTY_JOBS);
        }
-       else if (!job->printer)
+       else if (!JobHistory && !job->printer)
        {
         /*
          * Delete the job immediately if not actively printing...
@@ -2876,12 +2879,14 @@ cupsdUpdateJobs(void)
       else
        job->file_time = INT_MAX;
 
+      cupsdLogJob(job, CUPSD_LOG_DEBUG2, "cupsdUpdateJobs: job->file_time=%ld, time-at-completed=%ld, JobFiles=%d", (long)job->file_time, (long)attr->values[0].integer, JobFiles);
+
       if (job->file_time < JobHistoryUpdate || !JobHistoryUpdate)
        JobHistoryUpdate = job->file_time;
     }
   }
 
-  cupsdLogMessage(CUPSD_LOG_DEBUG2, "cupsdUpdateAllJobs: JobHistoryUpdate=%ld",
+  cupsdLogMessage(CUPSD_LOG_DEBUG2, "cupsdUpdateJobs: JobHistoryUpdate=%ld",
                   (long)JobHistoryUpdate);
 }
 
@@ -4601,7 +4606,7 @@ set_time(cupsd_job_t *job,                /* I - Job to update */
       JobHistoryUpdate = job->history_time;
 
     if (JobFiles < INT_MAX && attr)
-      job->file_time = attr->values[0].integer + JobFiles;
+      job->file_time = curtime + JobFiles;
     else
       job->file_time = INT_MAX;