Changelog for HylaFAX 4.2.0
+* fix V.17 fallbacks after the CTC/CTR exchange (21 Jun 2004)
* tune setting of -rpath when linking on linux (21 Jun 2004)
* add admin option and dialstring alteration to faxalter (20 Jun 2004)
* add -end option for xferfaxstats and recvstats (17 Jun 2004)
u_short pprcnt = 0;
u_int fcount = 0;
u_short syncattempts = 0;
- bool blockgood = false;
+ bool blockgood = false, dolongtrain = false;
do {
sentERR = false;
resetBlock();
emsg = "Failure to receive silence.";
return (false);
}
- fxStr rmCmd(curcap[HasShortTraining(curcap)].value, rmCmdFmt);
+ /*
+ * T.30 Section 5, Note 5 states that we must use long training
+ * on the first high-speed data message following CTR.
+ */
+ fxStr rmCmd;
+ if (dolongtrain) rmCmd = fxStr(curcap->value, rmCmdFmt);
+ else rmCmd = fxStr(curcap[HasShortTraining(curcap)].value, rmCmdFmt);
u_short attempts = 0;
ATResponse response = AT_NOTHING;
while ((response == AT_NOTHING || response == AT_FCERROR) && attempts++ < 20) {
if (wasTimeout()) abortReceive(); // return to command mode
return (false);
}
+ dolongtrain = false;
} else {
if (!gotEOT) {
bool gotprimary = waitForDCEChannel(false);
}
(void) transmitFrame(FCF_CTR|FCF_RCVR);
tracePPR("RECV send", FCF_CTR);
+ dolongtrain = true;
break;
case FCF_EOR:
tracePPM("RECV recv", rtnframe.getFCF2());
if (curcap) {
/*
* Hunt for compatibility with remote at this baud rate.
- * We don't drop from V.29 to V.17 because...
- * 1) it will lock up the hardware on some receivers
- * 2) if the receiver supports V.17 then we probably tried
- * it already without success
+ * We don't drop from V.29 to V.17 because if the
+ * receiver supports V.17 then we probably tried
+ * it already without success.
*/
while (curcap->br == params.br) {
if (isCapable(curcap->sr, dis) && !(oldcap->mod == V29 && curcap->mod == V17))
char ppr[32]; // 256 bits
for (u_int i = 0; i < 32; i++) ppr[i] = 0xff;
u_short badframes = frameNumber, badframesbefore = 0;
+ bool dolongtrain = false;
do {
u_short fcount = 0;
setXONXOFF(FLOW_XONXOFF, FLOW_NONE, ACT_FLUSH);
if (!useV34) {
pause(conf.class1SendMsgDelay); // T.30 5.3.2.4
- fxStr tmCmd(curcap[HasShortTraining(curcap)].value, tmCmdFmt);
+ /*
+ * T.30 Section 5, Note 5 states that we must use long training
+ * on the first high-speed data message following CTC.
+ */
+ fxStr tmCmd;
+ if (dolongtrain) tmCmd = fxStr(curcap->value, tmCmdFmt);
+ else tmCmd = fxStr(curcap[HasShortTraining(curcap)].value, tmCmdFmt);
if (!atCmd(tmCmd, AT_CONNECT))
return (false);
pause(conf.class1TMConnectDelay);
}
+ dolongtrain = false;
// The block is assembled. Transmit it, adding transparent DLEs. End with DLE+ETX.
u_char buf[2];
protoTrace(emsg);
return (false);
}
+ dolongtrain = true; // T.30 states that we must use long-training next
} else {
/*
* At this point data corruption is inevitable if all data