protoTrace(emsg);
return (send_failed);
}
- FaxSendStatus status =
- sendSetupParams(tif, next, info, emsg);
- if (status != send_ok)
- return (status);
+ /*
+ * The session parameters cannot change except following
+ * the reception of an RTN signal or the transmission of an
+ * EOM signal.
+ *
+ * Since we did not receive RTN, and since batching (EOM)
+ * triggers retraining in other ways, we require that the
+ * next page have the same characteristics as this page.
+ */
+ next = params;
}
break;
case FCF_DCN: // disconnect, abort
emsg = "Problem reading document directory";
goto failed;
}
- FaxSendStatus status =
- sendSetupParams(tif, next, info, emsg);
- if (status != send_ok) {
- sendAbort();
- return (status);
- }
+ /*
+ * The session parameters cannot change except following
+ * the reception of an RTN signal or the transmission of an
+ * EOM signal.
+ *
+ * Since we did not receive RTN, and since batching (EOM)
+ * triggers retraining in other ways, we require that the
+ * next page have the same characteristics as this page.
+ */
+ next = params;
}
transferOK = true;
break;
/*
* Group 3 protocol forces any sends to precede any polling.
*/
- fax.status = send_done; // be optimistic
+ fax.status = send_failed;
+ bool dosetup = true;
while (fax.items.length() > 0) { // send operations
u_int i = fax.findItem(FaxRequest::send_fax);
if (i == fx_invalidArrayIndex)
FaxItem& freq = fax.items[i];
traceProtocol("SEND file \"%s\"", (const char*) freq.item);
fileStart = pageStart = Sys::now();
- if (!sendFaxPhaseB(fax, freq, clientInfo, batched)) {
+ if (!sendFaxPhaseB(fax, freq, clientInfo, batched, dosetup)) {
/*
* Prevent repeated batching errors.
*/
* find again at the top of the loop
*/
notifyDocumentSent(fax, i);
+ dosetup = false;
}
if (fax.status == send_done &&
fax.findItem(FaxRequest::send_poll) != fx_invalidArrayIndex)
* Phase B of Group 3 protocol.
*/
bool
-FaxServer::sendFaxPhaseB(FaxRequest& fax, FaxItem& freq, FaxMachineInfo& clientInfo, u_int batched)
+FaxServer::sendFaxPhaseB(FaxRequest& fax, FaxItem& freq, FaxMachineInfo& clientInfo, u_int batched, bool dosetup)
{
- fax.status = send_failed; // assume failure
-
TIFF* tif = TIFFOpen(freq.item, "r");
if (tif && (freq.dirnum == 0 || TIFFSetDirectory(tif, freq.dirnum))) {
- // set up DCS according to file characteristics
- fax.status = sendSetupParams(tif, clientParams, clientInfo, fax.notice);
+ if (dosetup) {
+ // set up DCS according to file characteristics
+ fax.status = sendSetupParams(tif, clientParams, clientInfo, fax.notice);
+ }
if (fax.status == send_ok) {
/*
* Count pages sent and advance dirnum so that if we
// FAX transmission protocol support
void sendFax(FaxRequest& fax, FaxMachineInfo&, const fxStr& number, u_int&);
bool sendClientCapabilitiesOK(FaxRequest&, FaxMachineInfo&, fxStr&);
- bool sendFaxPhaseB(FaxRequest&, FaxItem&, FaxMachineInfo&, u_int);
+ bool sendFaxPhaseB(FaxRequest&, FaxItem&, FaxMachineInfo&, u_int, bool);
void sendPoll(FaxRequest& fax, bool remoteHasDoc);
FaxSendStatus sendSetupParams(TIFF*,
Class2Params&, const FaxMachineInfo&, fxStr&);