]> git.ipfire.org Git - thirdparty/HylaFAX.git/commitdiff
Bug 118: fix a couple of logic errors in the Class 2 "batch failed" checks
authorLee Howard <faxguy@howardsilvan.com>
Thu, 10 Jun 2004 00:52:15 +0000 (00:52 +0000)
committerLee Howard <faxguy@howardsilvan.com>
Thu, 10 Jun 2004 00:52:15 +0000 (00:52 +0000)
CHANGES
faxd/Class2Send.c++

diff --git a/CHANGES b/CHANGES
index 424da296965e67d78796bf19bb957cc769623474..b07b3ce9386e34403e7bb51bd7da56362a6ecefe 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -33,7 +33,7 @@ Changelog for HylaFAX 4.2.0
 * handle repeated PPS, DCS, or EOR signals in V.34-Fax (26 Apr 2004)
 * attempt to handle CTC signals from broken senders (26 Apr 2004)
 * improved pagermap backreference error handling (22 Apr 2004)
-* add batching support to faxsend (19 Apr 2004)
+* add batching support to faxsend (19 Apr, 9 Jun 2004)
 * change MaxConcurrentJobs to MaxConcurrentCalls (19 Apr 2004)
 * improve V.34-Fax renegotiations by dropping 4800 bps per step (12 Apr 2004)
 * improve some V.34-Fax error logging and handling (12, 19 Apr 2004)
index 7f184673e6823bda2570c613f138a73153090c58..afdf0335c45d5907b8808e628e3db5e505d8477d 100644 (file)
@@ -242,6 +242,7 @@ Class2Modem::sendPhaseB(TIFF* tif, Class2Params& next, FaxMachineInfo& info,
     fxStr& pph, fxStr& emsg, u_int& batched)
 {
     int ntrys = 0;                     // # retraining/command repeats
+    u_int ppm, previousppm = 0;
 
     setDataTimeout(60, next.br);       // 60 seconds for 1024 byte writes
     hangupCode[0] = '\0';
@@ -270,7 +271,6 @@ Class2Modem::sendPhaseB(TIFF* tif, Class2Params& next, FaxMachineInfo& info,
             * remote station (XXX need to deal with PRI requests).).
             */
            morePages = !TIFFLastDirectory(tif);
-           u_int ppm;
            if (!decodePPM(pph, ppm, emsg))
                goto failed;
 
@@ -347,7 +347,7 @@ Class2Modem::sendPhaseB(TIFF* tif, Class2Params& next, FaxMachineInfo& info,
                /*
                 * We received no PPR.
                 */
-               if (ppm = PPM_EOM && (batched & BATCH_FIRST)) {
+               if (ppm == PPM_EOM && (batched & BATCH_FIRST)) {
                    emsg = "Batching protocol error";
                    protoTrace("The destination appears to not support batching.");
                    return (send_batchfail);
@@ -357,12 +357,13 @@ Class2Modem::sendPhaseB(TIFF* tif, Class2Params& next, FaxMachineInfo& info,
            /*
             * We were unable to negotiate settings and transfer page image data.
             */
-           if (!(batched & BATCH_FIRST)) {
+           if (previousppm == PPM_EOM) {
                emsg = "Batching protocol error";
                protoTrace("The destination appears to not support batching.");
                return (send_batchfail);
            }
        }
+       previousppm = ppm;
     } while (transferOK && morePages && !hadHangup);
     if (!transferOK) {
        if (emsg == "") {