Revision: 9654 https://osdn.net/projects/ttssh2/scm/svn/commits/9654 Author: zmatsuo Date: 2021-12-30 02:01:39 +0900 (Thu, 30 Dec 2021) Log Message: ----------- XMODEM送信時の挙動の改善 - 送信開始時の動作 - 受信側から送信されている処理されていない古いコマンドから解釈していた - 古い通信を破棄して最新のコマンドを解釈するようにした ticket #43221, #33708, #39012, #39667 Merge from 4-stable: r9649 Revision Links: -------------- https://osdn.net/projects/ttssh2/scm/svn/commits/9649 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: -------------- trunk/doc/en/html/about/history.html trunk/doc/ja/html/about/history.html trunk/teraterm/teraterm/filesys_proto.cpp trunk/teraterm/ttpfile/xmodem.c -------------- next part -------------- Modified: trunk/doc/en/html/about/history.html =================================================================== --- trunk/doc/en/html/about/history.html 2021-12-29 17:01:27 UTC (rev 9653) +++ trunk/doc/en/html/about/history.html 2021-12-29 17:01:39 UTC (rev 9654) @@ -33,11 +33,11 @@ <h3 id="teraterm_5.0">202x.xx.xx (Ver 5.0)</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: trunk/doc/ja/html/about/history.html =================================================================== --- trunk/doc/ja/html/about/history.html 2021-12-29 17:01:27 UTC (rev 9653) +++ trunk/doc/ja/html/about/history.html 2021-12-29 17:01:39 UTC (rev 9654) @@ -33,11 +33,11 @@ <h3 id="teraterm_5.0">202x.xx.xx (Ver 5.0)</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: trunk/teraterm/teraterm/filesys_proto.cpp =================================================================== --- trunk/teraterm/teraterm/filesys_proto.cpp 2021-12-29 17:01:27 UTC (rev 9653) +++ trunk/teraterm/teraterm/filesys_proto.cpp 2021-12-29 17:01:39 UTC (rev 9654) @@ -759,6 +759,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 + PFileVarProto fv = FileVar; if (fv->Parse(fv, &cv)) P = 0; /* continue */ Modified: trunk/teraterm/ttpfile/xmodem.c =================================================================== --- trunk/teraterm/ttpfile/xmodem.c 2021-12-29 17:01:27 UTC (rev 9653) +++ trunk/teraterm/ttpfile/xmodem.c 2021-12-29 17:01:39 UTC (rev 9654) @@ -483,12 +483,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) { @@ -503,13 +506,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; @@ -532,11 +537,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 fv->FTSetTimeOut(fv, xv->TOutVLong);