poderosaproject / poderosa

Terminal Emulator Poderosa - Source
Apache License 2.0
223 stars 90 forks source link

ZModem/XModem doesn't work. #23

Closed minico closed 7 years ago

minico commented 8 years ago

ZModem/XModem doesn't work.

poderosaproject commented 7 years ago

I confirmed the issue. I will fix it.

poderosaproject commented 7 years ago

ZMODEM file transfer was re-implemented. XMODEM has not been updated yet.

b07cbc712861cb163d33c35a57c83b802050b9ba...f61a279373423c0e9042db76faf8bd4a81ee23cc

minico commented 7 years ago

It ways failed when I tried to upload big file(for example 50M). SecureCRT implements ZModem in a good way, when I type "rz" or "sz" in terminal, the upload or download dialog will appear automatically.

poderosaproject commented 7 years ago

Which connection type are you using? Telnet? SSH? or SerialPort? Which version of operating system is running on the remote side?

minico commented 7 years ago
  1. I use ssh2.
  2. Remote side OS inforamtion: $uname -na Linux 2.6.32-431.el6.x86_64 #1 SMP Fri Nov 22 03:15:09 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux $cat /etc/issue CentOS release 6.5 (Final) Kernel \r on an \m
  3. When transfer failed, a dialog popup, says "Aborted by peer".
poderosaproject commented 7 years ago

Thank you for the information !

poderosaproject commented 7 years ago

You would have noticed that the transfer speed slows down soon after the file transfer was started. It is caused by the flow control of the SSH protocol that is based on the "window" size. Default window size of Poderosa is 4096 bytes, and it is too small to the ZMODEM protocol. Small window size causes the delay of the data transfer, and sz may detect it as the transfer error.

Try larger SSH window size. To change the SSH window size, Open Tools > Detailed preference editor, then edit the value of "org.poderosa.protocols.sshWindowSize".

16384 or larger value (like 65536) would improve the data transfer. 262144 would be enough to the binary data transfer like SCP or SFTP.

I have tested ZMODEM file transfer of the 500mb binary file with the large window setting, and the transfer was completed successfully.

minico commented 7 years ago

Thank you for your response, but the solution seems not work for my case:( I changed the sshWindowSize to 262144, but I still get the same error as before.

minico commented 7 years ago

OK, I know why it fails.

If I open the XZModerm dialog and send a file to server, it will fail for large file, but succeed for small file.

I think the correct method should be:

  1. run rz command from terminal;
  2. and then open the XZModerm dialog and send file to server, large file will also be uploaded successfully.
poderosaproject commented 7 years ago

Data resending was fixed. Now TCP_NODELAY is used for the SSH or TELNET. It will improve the file transfer rate. (and will reduce error on the remote side)

16528775af8ebe41704bd32851cbf9b21d939592...8a0a7818bd3e29bd89684562f12b79d73824a0ed

minico commented 7 years ago

Thank you for the quick fix.