]> git.ipfire.org Git - thirdparty/HylaFAX.git/commitdiff
Class1: Abort on timeout waiting for carrier drop in ECM
authorAidan Van Dyk <aidan@ifax.com>
Wed, 26 Sep 2007 12:58:51 +0000 (12:58 +0000)
committerAidan Van Dyk <aidan@ifax.com>
Wed, 26 Sep 2007 12:58:51 +0000 (12:58 +0000)
From Lee:
| commit d22b1490d181a6b2afa58becbed2b84bcdab9da7
| Author: Lee Howard <faxguy@howardsilvan.com>
| Date:   Sat Sep 1 01:14:02 2007 +0000
|
|   If we have a timeout waiting for the carrier drop then we have to abort
|   to get the modem into command mode and abort the fax receive.

faxd/Class1.c++
faxd/Class1Recv.c++
faxd/STATUS.txt

index 38e9a13f77c8b57b51cbe169dc2b088552c7acdc..de07085dd4abb8a8627f0842613420250afa003e 100644 (file)
@@ -1145,9 +1145,11 @@ Class1Modem::endECMBlock()
 
     int c = getLastByte();             // some erroniously re-use bits 
     time_t start = Sys::now();
+    setTimeout(false);
     do {
        if ((unsigned) Sys::now()-start >= 60) {        // 60 seconds of garbage after RCP is too much
            protoTrace("Timeout waiting for DLE+ETX");
+           setTimeout(true);
            return false;
        }
        if (c == DLE) {
index 8025cd5df4ca316f83095577dc41c9de2a06e849..86178cecbe88168585fb51b48471074b2415937f 100644 (file)
@@ -1401,7 +1401,15 @@ Class1Modem::recvPageECMData(TIFF* tif, const Class2Params& params, Status& eres
                        return (false);
                    }
                } else {
-                   endECMBlock();                              // wait for <DLE><ETX>
+                   if (!endECMBlock()) {                               // wait for <DLE><ETX>
+                       if (wasTimeout()) {
+                           abortReceive();
+                           eresult = Status(154, "Timeout waiting for Phase C carrier drop");
+                           protoTrace("%s", eresult.string());
+                           abortPageECMRecv(tif, params, block, fcount, seq, pagedataseen);
+                           return (false);
+                       }
+                   }
                }
                if (!useV34) {
                    // wait for message carrier to drop
index e40b765dbabe83f8c3f45f1d84e70e6b94318e44..9be23b1eb2f409d84f094077cbbf6a0ced3a6a46 100644 (file)
@@ -75,6 +75,7 @@
 151      : No response to EOP repeated 3 tries
 152      : No response to EOM repeated 3 tries
 153      : No response to PPM repeated 3 tries
+154      : Timeout waiting for Phase C carrier drop
 
 200-299 : Class 2-specific protocol failure
 ===============================================================================