]> git.ipfire.org Git - thirdparty/HylaFAX.git/commitdiff
Class1: Improve ECM synchronization timeout handling:
authorAidan Van Dyk <aidan@ifax.com>
Mon, 26 Nov 2007 14:01:38 +0000 (14:01 +0000)
committerAidan Van Dyk <aidan@ifax.com>
Mon, 26 Nov 2007 14:01:38 +0000 (14:01 +0000)
| commit 098f7daa6e5066ce6fabca1e81c342e8c4866f51
| Author: Lee Howard <faxguy@howardsilvan.com>
| Date:   Tue Sep 18 03:26:53 2007 +0000
|
|     This should do it (I think) for all of this previously untested/unrefined
|     ECM sync timeout handling.

faxd/Class1.c++
faxd/Class1Recv.c++

index de07085dd4abb8a8627f0842613420250afa003e..397510bd61b7232275340ca3559720cc1ce448d7 100644 (file)
@@ -563,7 +563,7 @@ Class1Modem::abortReceive()
        flushModemInput();
        (void) atCmd("AT", AT_OK, 100);
     } else
-       (void) waitFor(AT_OK, conf.class1RecvAbortOK);
+       while (!waitFor(AT_OK, conf.class1RecvAbortOK) && lastResponse == AT_OTHER && !wasTimeout());
     setTimeout(b);                     // XXX putModem clobbers timeout state
 }
 
index 6febf8d92f39577b58471e8b2049bed19b1880d5..86265b44f2527d18f533e944c6191db5c83d0317 100644 (file)
@@ -1115,13 +1115,14 @@ Class1Modem::recvPageECMData(TIFF* tif, const Class2Params& params, Status& eres
        u_int fcount = 0;
        u_short syncattempts = 0;
        bool blockgood = false, dolongtrain = false;
+       bool gotoPhaseD = false;
        do {
            sendERR = false;
            resetBlock();
            signalRcvd = 0;
            rcpcnt = 0;
            bool dataseen = false;
-           if (!useV34) {
+           if (!useV34 && !gotoPhaseD) {
                gotRTNC = false;
                if (!raiseRecvCarrier(dolongtrain, eresult) && !gotRTNC) {
                    if (wasTimeout()) {
@@ -1356,6 +1357,7 @@ Class1Modem::recvPageECMData(TIFF* tif, const Class2Params& params, Status& eres
            setInputBuffering(true);
            if (flowControl == FLOW_XONXOFF)
                (void) setXONXOFF(FLOW_NONE, FLOW_XONXOFF, ACT_FLUSH);
+           gotoPhaseD = false;
            if (!sendERR && (useV34 || syncECMFrame())) {       // no synchronization needed w/V.34-fax
                time_t start = Sys::now();
                do {
@@ -1715,6 +1717,7 @@ Class1Modem::recvPageECMData(TIFF* tif, const Class2Params& params, Status& eres
                        // must now await V.21 signalling
                        long wait = BIT(curcap->br) & BR_ALL ? 273066 / (curcap->br+1) : conf.t2Timer;
                        gotRTNC = atCmd(rhCmd, AT_CONNECT, wait);
+                       gotoPhaseD = gotRTNC;
                        if (!gotRTNC) syncattempts = 21;
                    }
                }