Changelog for HylaFAX 4.2.1
+* extend short send-HDLC timeouts (18 Aug 2004)
* add a pause after receiving MCF on non-ECM send sessions (18 Aug 2004)
* fix broken fax polling (17 Aug 2004)
* add several timing enhancements for stressed servers (16 Aug 2004)
bool
Class1Modem::transmitFrame(u_char fcf, bool lastFrame)
{
- startTimeout(2550); // 3.0 - 15% = 2.55 secs
+ startTimeout(7550);
bool frameSent =
(useV34 ? true : atCmd(thCmd, AT_NOTHING, 0)) &&
(useV34 ? true : atResponse(rbuf, 0) == AT_CONNECT) &&
{
/*
* The T.30 spec says no frame can take more than 3 seconds
- * (+/- 15%) to transmit. We take the conservative approach.
- * and guard against the send exceeding the lower bound.
+ * (+/- 15%) to transmit. But the DCE can take as much as 5
+ * seconds to respond CONNECT or result OK, per T.31.
*/
- startTimeout(2550); // 3.0 - 15% = 2.55 secs
+ startTimeout(7550);
bool frameSent =
(useV34 ? true : atCmd(thCmd, AT_NOTHING, 0)) &&
(useV34 ? true : atResponse(rbuf, 0) == AT_CONNECT) &&
bool
Class1Modem::transmitFrame(u_char fcf, const fxStr& tsi, bool lastFrame)
{
- startTimeout(3000); // give more time than others
+ startTimeout(7550);
bool frameSent =
(useV34 ? true : atCmd(thCmd, AT_NOTHING, 0)) &&
(useV34 ? true : atResponse(rbuf, 0) == AT_CONNECT) &&
bool
Class1Modem::transmitFrame(u_char fcf, const u_char* code, const fxStr& nsf, bool lastFrame)
{
- startTimeout(3000); // give more time than others
+ startTimeout(7550);
bool frameSent =
(useV34 ? true : atCmd(thCmd, AT_NOTHING, 0)) &&
(useV34 ? true : atResponse(rbuf, 0) == AT_CONNECT) &&
pageGood = false; // quality of received page
return atCmd(thCmd, AT_NOTHING) &&
- atResponse(rbuf, 2550) == AT_CONNECT &&
+ atResponse(rbuf, 7550) == AT_CONNECT &&
recvIdentification(
(send&DIS_PWD ? FCF_PPW : 0), pwd,
(send&DIS_SEP ? FCF_SEP : 0), sep,
* station or (PWD) (SEP) (CIG) DTC when initiating a poll.
*/
if (f1) {
- startTimeout(3000);
+ startTimeout(7550);
framesSent = sendFrame(f1, pwd, false);
stopTimeout("sending PWD frame");
} else if (f2) {
- startTimeout(3000);
+ startTimeout(7550);
framesSent = sendFrame(f2, addr, false);
stopTimeout("sending SUB/SEP frame");
} else if (f3) {
- startTimeout(3000);
+ startTimeout(7550);
framesSent = sendFrame(f3, (const u_char*)HYLAFAX_NSF, nsf, false);
stopTimeout("sending NSF frame");
} else {
- startTimeout(3000);
+ startTimeout(7550);
framesSent = sendFrame(f4, id, false);
stopTimeout("sending CSI/CIG frame");
}
for (;;) {
if (framesSent) {
if (f1) {
- startTimeout(2550);
+ startTimeout(7550);
framesSent = sendFrame(f2, addr, false);
stopTimeout("sending SUB/SEP frame");
}
if (framesSent && f2) {
- startTimeout(2550);
+ startTimeout(7550);
framesSent = sendFrame(f3, (const u_char*)HYLAFAX_NSF, nsf, false);
stopTimeout("sending NSF frame");
}
if (framesSent && f3) {
- startTimeout(2550);
+ startTimeout(7550);
framesSent = sendFrame(f4, id, false);
stopTimeout("sending CSI/CIG frame");
}
if (framesSent) {
- startTimeout(2550);
+ startTimeout(7550);
framesSent = sendFrame(f5, dics, xinfo);
stopTimeout("sending DIS/DCS frame");
}
* The carrier is already raised. Thus we
* use sendFrame() instead of transmitFrame().
*/
- startTimeout(2550);
+ startTimeout(7550);
(void) sendFrame((sendERR ? FCF_ERR : FCF_MCF)|FCF_RCVR);
stopTimeout("sending HDLC frame");
}
bool
Class1Modem::sendPrologue(u_int dcs, u_int dcs_xinfo, const fxStr& tsi)
{
+ /*
+ * T.31 8.3.5 requires the DCE to respond CONNECT or result OK within
+ * five seconds or it must result ERROR. T.30 requires the data of
+ * the HDLC frame to be tranmsitted in 3 s +/- 15%. Thus, our
+ * timeouts here must be at least 7500 ms and no more than 8500 ms.
+ */
bool frameSent;
if (useV34) frameSent = true;
- else frameSent = (atCmd(thCmd, AT_NOTHING) && atResponse(rbuf, 2550) == AT_CONNECT);
+ else frameSent = (atCmd(thCmd, AT_NOTHING) && atResponse(rbuf, 7550) == AT_CONNECT);
if (!frameSent)
return (false);
if (pwd != fxStr::null) {
- startTimeout(2550); // 3.0 - 15% = 2.55 secs
+ startTimeout(7550);
bool frameSent = sendFrame(FCF_PWD|FCF_SNDR, pwd, false);
stopTimeout("sending PWD frame");
if (!frameSent)
return (false);
}
if (sub != fxStr::null) {
- startTimeout(2550); // 3.0 - 15% = 2.55 secs
+ startTimeout(7550);
bool frameSent = sendFrame(FCF_SUB|FCF_SNDR, sub, false);
stopTimeout("sending SUB frame");
if (!frameSent)
return (false);
}
- startTimeout(2550); // 3.0 - 15% = 2.55 secs
+ startTimeout(7550);
frameSent = sendFrame(FCF_TSI|FCF_SNDR, tsi, false);
stopTimeout("sending TSI frame");
if (!frameSent)
return (false);
- startTimeout(2550); // 3.0 - 15% = 2.55 secs
+ startTimeout(7550);
frameSent = sendFrame(FCF_DCS|FCF_SNDR, dcs, dcs_xinfo);
stopTimeout("sending DCS frame");
return (frameSent);