tehmaze/xmodem — pull request #11 by jquast (2014-12-29 08:50:14+00:00)
Title: Bugfix issue #7 on crc checksum failure

(Pull PR #8 first for smaller diff)

When a CRC checksum failure occurs and NAK is sent,

1. we should purge any awaiting stdin as suggested by
ymodem.txt and documented therein, i would suppose
this may only be for ymodem, which has a kind of
readahead buffer, though. For xmodem local testing
piped with lrzsz, no data is purged.

2. we should read the next start-of-header block, as
is usually done when the checksum is valid -- this
causes our 'seq1' to be SOH or STX, and seq2 fails
1's complement and subsequent failures about unexpected
sequence occur, otherwise.