exsilium / xmodem.js

XMODEM implementation in JavaScript
BSD 2-Clause "Simplified" License
12 stars 6 forks source link

If EOT block is not acknowledged, xmodem.js doesn't resend the EOT block again #1

Closed afroewis closed 6 years ago

afroewis commented 6 years ago

I had the following situation while using this package:

  1. After the file was sent, xmodem.js sends EOT.
  2. Receiver responds with NAK.
  3. xmodem.js sends the last sent xmodem block again.

I think that this is not correct. Instead of sending the last block again, it should send the EOT command again.

When the uploader sends an EOT byte instead of an SOH byte, the downloader sends a NAK byte. If the uploader sends another EOT immediately after that, the downloader sends an ACK byte and the transfer is complete.

Or am I wrong?

I would be very happy to submit a PR for this, as I already fixed this problem on my local machine.

exsilium commented 6 years ago

Yup, definitely a bug! 🐛

afroewis commented 6 years ago

@exsilium, could you please publish this new version to npm? That would be awesome. Thank you!

exsilium commented 6 years ago

@afroewis , Will do, I wanted to make sure the test suite works. I'll try to publish this promptly.. Cheers! :beers: