• Support
  • Articles
  • Resources
  • Products

zmodem bug?

Moderator: boris

4 postsPage 1 of 1

Dirk
Newbie

Posts:
3
Joined: Mon Jun 13, 2016 8:50 am
by Dirk » Mon Jun 13, 2016 9:44 am
I'm working with zmodem in teraterm and get some transmission errors. I installed sources of teraterm to attempt to eliminate the cause of error. I found out that ZDEL decoding of binary headers is not completely implemented.

https://osdn.jp/projects/ttssh2/scm/svn/blobs/head/trunk/teraterm/ttpfile/zmodem.c
Line 1226

Code: Select all

  1.  
  2.                                          if (zv->Quoted) {
  3.                                                  b = b ^ 0x40;
  4.                                                  zv->Quoted = FALSE;
  5.                                          }
  6.  

On the ather hand ZDEL decoding of data is full implemented
https://osdn.jp/projects/ttssh2/scm/svn/blobs/head/trunk/teraterm/ttpfile/zmodem.c
Line 1278

Code: Select all

  1.  
  2.                                         if (zv->Quoted) {
  3.                                                  switch (b) {
  4.                                                  case ZCRCE:
  5.                                                  case ZCRCG:
  6.                                                  case ZCRCQ:
  7.                                                  case ZCRCW:
  8.                                                          zv->TERM = b;
  9.                                                          if (zv->CRC32)
  10.                                                                  zv->PktInCount = 4;
  11.                                                          else
  12.                                                                  zv->PktInCount = 2;
  13.                                                          zv->ZPktState = Z_PktGetCRC;
  14.                                                          break;
  15.                                                  case ZRUB0:
  16.                                                          b = 0x7F;
  17.                                                          break;
  18.                                                  case ZRUB1:
  19.                                                          b = 0xFF;
  20.                                                          break;
  21.                                                  default:
  22.                                                          b = b ^ 0x40;
  23.                                                  }
  24.  
  25.  


If I have a look in Chuck Forsberg "The ZMODEM Inter Application File Transfer Protocol"
http://pauillac.inria.fr/~doligez/zmodem/zmodem.txt
(7.2 Link Escape Encoding)

The receiving program decodes any sequence of ZDLE followed by a byte with bit 6 set and bit 5 reset (upper case letter, either parity) to the
equivalent control character by inverting bit 6. This allows the transmitter to escape any control character that cannot be sent by the
communications medium. In addition, the receiver recognizes escapes for 0177 and 0377 should these characters need to be escaped.


My understanding of Chuck Forsberg is that escaping for 0177 (0x7f) and 0377 (0xff) in binary headers for the transmitter is an option (teraterm doesn't use that) but for the receiver decoding of ZRUB0 and ZRUB1 is mandatory.

Is there any reason for not full decoding of binary headers?

If I change the code zmodem transfer works great.

Dirk
Yutaka Hirata
TeraTerm Developer

Posts:
606
Joined: Wed Jan 12, 2005 2:35 pm
by Yutaka Hirata » Wed Jun 15, 2016 12:45 pm
Hi Dirk,

Thank you for your feedback.
We are currently checking that point out in developer's team.
Please wait a while for the response.

Thanks.
Best regards, Yutaka Hirata
(yutakakn at gmail.com)
http://hp.vector.co.jp/authors/VA013320/
Yutaka Hirata
TeraTerm Developer

Posts:
606
Joined: Wed Jan 12, 2005 2:35 pm
by Yutaka Hirata » Mon Jun 20, 2016 1:43 pm
Hi Dirk,

I am sorry to trouble you, but please retrieve the ZMODEM.LOG
while your problem is reproducing. The log file is created by the
ZmodemLog entry enabling in the teraterm.ini file.

; ZMODEM log
ZmodemLog=on


Thanks.
Best regards, Yutaka Hirata
(yutakakn at gmail.com)
http://hp.vector.co.jp/authors/VA013320/
Dirk
Newbie

Posts:
3
Joined: Mon Jun 13, 2016 8:50 am
by Dirk » Sun Aug 28, 2016 2:51 pm
Hi Yutaka,

sorry for the long time...

The logfile shows a file transmission with zmodem (terraterm is receiving). The logfile is cutted only the last lines are interesting. At line 565 terraterm is sending a ZACK with the next file position (B039d170000)

Type 3 (ZACK), filepos: 0x179d

At line 570 terraterm is receiving a binary header:

2A 18 2A 18 41 0A 18 DD 17 00 00 18 6C 44
decoding is:
ZPAD, ZDLE, ZBIN, ZRPOS (Type 9), ZDLE, DD 17 00 00 18 ZRUB0 44

How we can see the filepos. of 9d17 is converted to ZDLE, DD, 17 (0x9d ^ 0x40 => 0xDD) works correct, but there is no decoding of ZRUB0 and the checksum goes fail. Terraterm is sending a ZRPOS header.

Regards
Dirk

Attachments

ZMODEM.zip
(14.5 KiB) Downloaded 23 times
Display posts from previous:
Sort by:

4 postsPage 1 of 1

Users browsing this forum: No registered users
cron