Revision: 9651 https://osdn.net/projects/ttssh2/scm/svn/commits/9651 Author: zmatsuo Date: 2021-12-30 00:58:15 +0900 (Thu, 30 Dec 2021) Log Message: ----------- XMODEM送信時の挙動の改善 - 送信開始時の動作 - 受信側から送信されている処理されていない古いコマンドから解釈していた - 古い通信を破棄して最新のコマンドを解釈するようにした ticket #43221, #33708, #39012, #39667 Ticket Links: ------------ https://osdn.net/projects/ttssh2/tracker/detail/43221 https://osdn.net/projects/ttssh2/tracker/detail/33708 https://osdn.net/projects/ttssh2/tracker/detail/39012 https://osdn.net/projects/ttssh2/tracker/detail/39667 Modified Paths: -------------- branches/4-stable/doc/en/html/about/history.html branches/4-stable/doc/ja/html/about/history.html branches/4-stable/teraterm/teraterm/filesys.cpp branches/4-stable/teraterm/ttpfile/xmodem.c -------------- next part -------------- Modified: branches/4-stable/doc/en/html/about/history.html =================================================================== --- branches/4-stable/doc/en/html/about/history.html 2021-12-29 14:49:47 UTC (rev 9650) +++ branches/4-stable/doc/en/html/about/history.html 2021-12-29 15:58:15 UTC (rev 9651) @@ -33,11 +33,11 @@ <h3 id="teraterm_4.107">2021.xx.xx (Ver 4.107)</h3> <ul class="history"> - <!-- li>Changes + <li>Changes <ul> - <li></li> + <li>Improved the stability of XMODEM transmission.</li> </ul> - </li --> + </li> <li>Bug fixes <ul> Modified: branches/4-stable/doc/ja/html/about/history.html =================================================================== --- branches/4-stable/doc/ja/html/about/history.html 2021-12-29 14:49:47 UTC (rev 9650) +++ branches/4-stable/doc/ja/html/about/history.html 2021-12-29 15:58:15 UTC (rev 9651) @@ -33,11 +33,11 @@ <h3 id="teraterm_4.107">2021.xx.xx (Ver 4.107)</h3> <ul class="history"> - <!-- li>\x95ύX + <li>\x95ύX <ul> - <li></li> + <li>XMODEM \x91\x97\x90M\x8E\x9E\x82̈\xC0\x92萫\x8C\xFC\x8F\xE3</li> </ul> - </li --> + </li> <li>\x83o\x83O\x8FC\x90\xB3 <ul> Modified: branches/4-stable/teraterm/teraterm/filesys.cpp =================================================================== --- branches/4-stable/teraterm/teraterm/filesys.cpp 2021-12-29 14:49:47 UTC (rev 9650) +++ branches/4-stable/teraterm/teraterm/filesys.cpp 2021-12-29 15:58:15 UTC (rev 9651) @@ -1608,6 +1608,8 @@ if (PtDlg==NULL) return P; + CommReceive(&cv); //\x83_\x83C\x83A\x83\x8D\x83O\x95\\x8E\xA6\x92\x86\x82Ɏ\xF3\x90M\x82\xB5\x82\xBD\x83f\x81[\x83^\x82\xF0\x8F\x88\x97\x9D\x82ł\xAB\x82\xE9\x82悤\x82ɓǂݎ\xE6\x82\xE8\x82\xF0\x8Ds\x82킹\x82\xE9 + if ((*ProtoParse)(ProtoId,FileVar,ProtoVar,&cv)) P = 0; /* continue */ else { Modified: branches/4-stable/teraterm/ttpfile/xmodem.c =================================================================== --- branches/4-stable/teraterm/ttpfile/xmodem.c 2021-12-29 14:49:47 UTC (rev 9650) +++ branches/4-stable/teraterm/ttpfile/xmodem.c 2021-12-29 15:58:15 UTC (rev 9651) @@ -429,12 +429,15 @@ int i; BOOL SendFlag; WORD Check; + BOOL is0x43Received = FALSE;//\x8E\xF3\x90M\x95\xB6\x8E\x9A\x82\xC9'C'(0x43)\x82\xAA\x8A܂܂\xEA\x82Ă\xA2\x82邩\x82̃t\x83\x89\x83O SendFlag = FALSE; if (xv->PktBufCount == 0) { - for (i=XRead1Byte(fv, xv, cv, &b); !SendFlag; i=XRead1Byte(fv, xv, cv, &b)) { + for(;;){ + i = XRead1Byte(fv, xv, cv, &b); if (i == 0) - return TRUE; + break; //\x90\xE6\x8Ds\x82\xB5\x82Ď\xF3\x90M\x82\xB5\x82\xBD\x95\xB6\x8E\x9A\x82\xAA\x91S\x82Ė\xB3\x82\xAD\x82Ȃ\xE9\x82܂ŌJ\x82\xE8\x95Ԃ\xB7(CAN CAN\x82̂ݑ\xA6\x8E\x9E\x83L\x83\x83\x83\x93\x83Z\x83\x8B) + switch (b) { case ACK: if (!fv->FileOpen) { @@ -449,13 +452,15 @@ break; case NAK: if (xv->PktNum == 0 && xv->PktNumOffset == 0) { - if (xv->XOpt == XoptCRC) { - // receiver wants to use checksum. - XSetOpt(fv, xv, XoptCheck); - } else if (xv->XOpt == Xopt1kCRC) { - /* we wanted 1k with CRC, but the other end specified checksum */ - /* keep the 1k block, but move back to checksum mode. */ - XSetOpt(fv, xv, Xopt1kCksum); + if (!is0x43Received) { //\x90\xE6\x82\xC9CRC\x97v\x8B\x81'C'(0x43)\x82\xF0\x8Et\x82\xAF\x82Ă\xA2\x82\xBD\x8Fꍇ\x82\xCDCRC\x83\x82\x81[\x83h\x82\xF0\x88ێ\x9D\x81B(CRC\x82ő\x97\x82\xC1\x82Ďt\x82\xAF\x82Ȃ\xA9\x82\xC1\x82\xBD\x8Fꍇ\x82\xCDNAK\x82𑗂\xC1\x82Ă\xAD\x82\xE9\x82͂\xB8\x82Ȃ̂\xC5CheckSum\x82ł̍đ\x97\x82ɐ\xE8\x91ւ\xED\x82\xE9) + if (xv->XOpt == XoptCRC) { + // receiver wants to use checksum. + XSetOpt(fv, xv, XoptCheck); + } else if (xv->XOpt == Xopt1kCRC) { + /* we wanted 1k with CRC, but the other end specified checksum */ + /* keep the 1k block, but move back to checksum mode. */ + XSetOpt(fv, xv, Xopt1kCksum); + } } } SendFlag = TRUE; @@ -478,11 +483,18 @@ XSetOpt(fv, xv, Xopt1kCRC); } SendFlag = TRUE; + is0x43Received = TRUE;//CRC\x82ŗv\x8B\x81\x82\xAA\x82\xA0\x82\xC1\x82\xBD } break; } xv->CANCount = 0; } + + if (!SendFlag){ + return TRUE; //\x91\x97\x90M\x82\xB7\x82\xE9\x82\xE0\x82̂\xAA\x82Ȃ\xA2\x82Ȃ珈\x97\x9D\x82\xAF\x82\xE9 + } + + // reset timeout timer FTSetTimeOut(fv, xv->TOutVLong);