From: Aidan Van Dyk Date: Mon, 26 Nov 2007 14:01:38 +0000 (+0000) Subject: Class1: Improve ECM synchronization timeout handling: X-Git-Tag: HYLAFAX-6_0_0-beta1~211 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f3605182bcf59cd3b5bfbe068c59c666f2a8b696;p=thirdparty%2FHylaFAX.git Class1: Improve ECM synchronization timeout handling: | commit 098f7daa6e5066ce6fabca1e81c342e8c4866f51 | Author: Lee Howard | 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. --- diff --git a/faxd/Class1.c++ b/faxd/Class1.c++ index de07085d..397510bd 100644 --- a/faxd/Class1.c++ +++ b/faxd/Class1.c++ @@ -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 } diff --git a/faxd/Class1Recv.c++ b/faxd/Class1Recv.c++ index 6febf8d9..86265b44 100644 --- a/faxd/Class1Recv.c++ +++ b/faxd/Class1Recv.c++ @@ -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; } }