]> git.ipfire.org Git - thirdparty/HylaFAX.git/commitdiff
Bug 118: if a job is blocked to a destination and the blocking job fails,
authorLee Howard <faxguy@howardsilvan.com>
Tue, 27 Sep 2005 19:23:13 +0000 (19:23 +0000)
committerLee Howard <faxguy@howardsilvan.com>
Tue, 27 Sep 2005 19:23:13 +0000 (19:23 +0000)
         then delay the blocked job also

CHANGES
faxd/faxQueueApp.c++

diff --git a/CHANGES b/CHANGES
index e9015d5f7d9848d09b08180142bba0ae38c48656..3415dba98a6ee8ae695bd733b1b7b911feacc0cf 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,7 @@
 
 Changelog for HylaFAX
 
+* delay blocked jobs on failure (27 Sep 2005)
 * batch sleeping jobs too (27 Sep 2005)
 * fix and improve copy quality correction (27 Sep 2005)
 * fix PAM support for non-passworded authentication (27 Sep 2005)
index 7ea4f03cd7d218c73bad650624d760577a1ae5c2..68ead0615be6c72e3e35733bbc0c31aea56db3ec 100644 (file)
@@ -1409,12 +1409,22 @@ faxQueueApp::sendJobDone(Job& job, int status)
 {
     Job* cjob;
     Job* njob;
-    FaxRequest* req;
-    FaxSendStatus cstatus = send_retry;
-
     DestInfo& di = destJobs[job.dest];
+    FaxRequest* req = readRequest(job);
+    if (req && req->status == send_retry) {
+       // prevent turnaround-redialing, delay any blocked jobs
+       time_t newtts = req->tts;
+       while (cjob = di.nextBlocked()) {
+           FaxRequest* blockedreq = readRequest(*cjob);
+           if (blockedreq) {
+               delayJob(*cjob, *blockedreq, "Delayed by prior call", newtts);
+               delete blockedreq;
+           }
+       }
+    } else {
+       unblockDestJobs(job, di);
+    }
     di.hangup();
-    unblockDestJobs(job, di);
     releaseModem(job);                         // done with modem
 
     traceQueue(job, "CMD DONE: exit status %#x", status);
@@ -1423,7 +1433,7 @@ faxQueueApp::sendJobDone(Job& job, int status)
 
     for (cjob = &job; cjob != NULL; cjob = njob) {
        njob = cjob->bnext;
-       req = readRequest(*cjob);               // reread the qfile
+       if (cjob != &job) req = readRequest(*cjob);     // the first was already read
        if (!req) {
            time_t now = Sys::now();
            time_t duration = now - job.start;