]> git.ipfire.org Git - thirdparty/HylaFAX.git/commitdiff
Class1: Imporve handling of DCN in Phase B
authorAidan Van Dyk <aidan@ifax.com>
Wed, 26 Sep 2007 12:54:29 +0000 (12:54 +0000)
committerAidan Van Dyk <aidan@ifax.com>
Wed, 26 Sep 2007 12:54:29 +0000 (12:54 +0000)
From Lee:
| commit c69d7f9043b7a2fcdef37e24227ffb67ced8e938
| Author: Lee Howard <faxguy@howardsilvan.com>
| Date:   Mon Jun 25 17:29:56 2007 +0000
|
|   Improves handling of DCN in Phase B, in particular when it's an unexpected
|   return to Phase B.

doc/RELEASENOTES-CVS.txt
faxd/Class1Recv.c++

index 973509503066a4f0b5940546665de32fdc2e448d..6530f88110d14d1074b430ec1c78639bdd2fb2d2 100644 (file)
@@ -29,3 +29,4 @@ Changes since 4.4 branched off
 * Disable MMR ond Digis (18 Sep 2007)
 * Class2: Fix EOFB bit order when usen LSB2MSB (18 Sep 2007)
 * Add prototype for ZyXEL Omni 56K Plus
+* Class1: Imporve handling of DCN in Phase B (18 Sep 2007)
index fa2ef6ae94ab74dccc41b44e0e698d16db34960b..5bd2109b284b7941564993611c0a7d9d7a61fa3d 100644 (file)
@@ -311,6 +311,7 @@ Class1Modem::recvDCSFrames(HDLCFrame& frame)
 {
     fxStr s;
     do {
+       traceFCF("RECV recv", frame.getFCF());
        switch (frame.getFCF()) {
        case FCF_PWD:
            recvPWD(decodePWD(s, frame));
@@ -325,13 +326,16 @@ Class1Modem::recvDCSFrames(HDLCFrame& frame)
            if (frame.getFrameDataLength() < 4) return (false); // minimum acceptable DCS frame size
            processDCSFrame(frame);
            break;
+       case FCF_DCN:
+           gotEOT = true;
+           recvdDCN = true;
+           break;
        }
-       traceFCF("RECV recv", frame.getFCF());
        /*
         * Sometimes echo is bad enough that we hear ourselves.  So if we hear DIS, we're probably
         * hearing ourselves.  Just ignore it and listen again.
         */
-    } while ((frame.moreFrames() || frame.getFCF() == FCF_DIS) && recvFrame(frame, FCF_RCVR, conf.t2Timer));
+    } while (!recvdDCN && (frame.moreFrames() || frame.getFCF() == FCF_DIS) && recvFrame(frame, FCF_RCVR, conf.t2Timer));
     return (frame.isOK() && frame.getFCF() == FCF_DCS);
 }
 
@@ -718,6 +722,12 @@ Class1Modem::recvPage(TIFF* tif, u_int& ppm, Status& eresult, const fxStr& id)
                    short traincount = 0;
                    do {
                        if (!messageReceived) messageReceived = !(recvDCSFrames(frame));
+                       if (recvdDCN) {
+                           messageReceived = true;
+                           signalRcvd = FCF_DCN;
+                           lastResponse = AT_NOTHING;
+                           break;
+                       }
                        if (!messageReceived) {
                            trainok = recvTraining();
                            messageReceived = (!trainok && lastResponse == AT_FRH3);