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.
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) {
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
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
===============================================================================