Based on Lee's work:
| commit
20678e9f4e755bcb192b93dfb6298d971d261b19
| Author: Lee Howard <faxguy@howardsilvan.com>
| Date: Sat Sep 30 15:56:55 2006 +0000
|
| this should handle the non-ECM case for gotCONNECT usage
| commit
de6ff8aa35e95d99cec03b46b8cf8f827f56db36
| Author: Lee Howard <faxguy@howardsilvan.com>
| Date: Sat Sep 30 02:19:11 2006 +0000
|
| On Sep 8 a change was made to recvFrame which caused (correctly so) the timeout
| value to be cleared after a successful abortReceive. However, the side-effect
| of this was that the "recv pps" portion of the ECM code was depending on that
| timeout value to know if CONNECT was even seen in the attempt or not.
|
| So this fixes that condition by creating a global flag specifically for this
| purpose. I hesitate a bit in doing it this way (I'd prefer to change recvFrame's
| exit value to int instead of bool), but right now it seems to most straight-
| forward approach.
Changelog since HylaFAX 4.3.3
+* We can't rely on the timeout value to know if CONNECT has been seen (12 Mar 2007)
* Calculate PPM/PPS waiter instead of using T1
* Improve response handling of AT+FRH=3 (12 Mar 2007)
* Improve ECM HDLC frame decoder to recover more quickly from data corruption
{
bool gotframe;
u_short crpcnt = 0;
+ gotCONNECT = true;
if (useV34) {
do {
if (crpcnt) traceFCF(dir == FCF_SNDR ? "SEND send" : "RECV send", FCF_CRP);
} while (!gotframe && docrp && crpcnt++ < 3 && !wasTimeout() &&
switchingPause(emsg) && transmitFrame(dir|FCF_CRP));
return (gotframe);
- } else if (lastResponse == AT_ERROR) gotEOT = true; // on hook
+ } else {
+ gotCONNECT = false;
+ if (lastResponse == AT_ERROR) gotEOT = true; // on hook
+ }
stopTimeout("waiting for v.21 carrier");
if (wasTimeout()) abortReceive();
return (false);
// V.34 indicators
bool useV34; // whether or not V.8 handhaking was used
bool gotEOT; // V.34-fax heard EOT signal
+ bool gotCONNECT; // whether or not CONNECT was seen
bool gotCTRL; // current channel indicator
bool gotRTNC; // retrain control channel
u_short primaryV34Rate; // rate indication for primary channel
time_t t2end = 0;
signalRcvd = 0;
sendERR = false;
+ gotCONNECT = true;
do {
u_int timer = conf.t2Timer;
messageReceived = true;
}
}
- if (wasTimeout()) abortReceive();
}
}
if (signalRcvd != 0) {
t2end = Sys::now() + howmany(conf.t2Timer, 1000);
}
}
- } while (!wasTimeout() && lastResponse != AT_EMPTYLINE);
+ } while (gotCONNECT && !wasTimeout() && lastResponse != AT_EMPTYLINE);
emsg = "T.30 T2 timeout, expected page not received";
if (prevPage && conf.saveUnconfirmedPages && getRecvEOLCount()) {
TIFFWriteDirectory(tif);
*/
long wait = (80*1024*8) / ((useV34 ? primaryV34Rate : curcap->br+1)*2400) * 1000;
gotpps = recvFrame(ppsframe, FCF_RCVR, wait); // wait longer
- } while (!gotpps && !wasTimeout() && !gotEOT && ++recvFrameCount < 5);
+ } while (!gotpps && gotCONNECT && !wasTimeout() && !gotEOT && ++recvFrameCount < 5);
if (gotpps) {
traceFCF("RECV recv", ppsframe.getFCF());
if (ppsframe.getFCF() == FCF_PPS) {