]> git.ipfire.org Git - thirdparty/HylaFAX.git/commitdiff
Handle situation when sender is not using ECM after negotiating it.
authorAidan Van Dyk <aidan@ifax.com>
Wed, 14 Mar 2007 18:31:19 +0000 (18:31 +0000)
committerAidan Van Dyk <aidan@ifax.com>
Wed, 14 Mar 2007 18:31:19 +0000 (18:31 +0000)
From Lee:
|  commit de49a7b7b5dc5a2b704ef844fe90053d568dd0b8
|  Author: Lee Howard <faxguy@howardsilvan.com>
|  Date:   Thu Jun 29 16:27:15 2006 +0000
|
|    handle instances where the sender transmits MPS/EOP/EOM after a bunch of
|    garbage ECM data - indicating that the sender is not using ECM ... even
|    though we appear to have negotiated it

CHANGES
faxd/Class1Recv.c++

diff --git a/CHANGES b/CHANGES
index 1cb95d50f1ab15e89ff806956e4fb9620094158a..a1ef623da82108eafaea641be5d7d121b3aaba60 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,8 @@
 
 Changelog since HylaFAX 4.3.3
 
+* Handle instances where ECM is negotiated but the sender
+  transmits non-ECM data and signalling (12 Mar 2007)
 * Handle MPS/EOP/EOM/CRP when expecting DCS, i.e. after RTN
 * Log correctly when a receiver DIS indicates no V.8 bit but
   V.8 was already known to have succeeded (12 Mar 2007)
index ea8fe5cbde21cc9692df7bf900964bc022dc6f24..a489dffd0fc48250c4548724efb82406d1d08160 100644 (file)
@@ -737,7 +737,22 @@ Class1Modem::recvPage(TIFF* tif, u_int& ppm, fxStr& emsg, const fxStr& id)
                if (!getRecvEOLCount()) {
                    // We have a null page, don't save it because it makes readers fail.
                    pageGood = false;
-                   if (params.ec != EC_DISABLE) return (false);
+                   if (params.ec != EC_DISABLE) {
+                       if (emsg == "") {
+                           /*
+                            * We negotiated ECM, got no valid ECM image data, and the 
+                            * ECM page reception routines did not set an error message.
+                            * The empty emsg is due to the ECM routines detecting a 
+                            * non-ECM-specific partial-page signal and wants it to
+                            * be handled here.  The sum total of all of this, and the 
+                            * fact that we got MPS/EOP/EOM tells us that the sender
+                            * is not using ECM.  In an effort to salvage the session we'll
+                            * disable ECM now and try to continue.
+                            */
+                           params.ec = EC_DISABLE;
+                       } else
+                           return (false);
+                   }
                }
                if (!pageGood && conf.badPageHandling == FaxModem::BADPAGE_RTN)
                    recvResetPage(tif);