Amendments on July 12, 2022
Make session_menu a bit more helpful and hide options with a null key
set, don't repeat "Invalid option" more than once
Add session_get_char for file transfers
Amendments on July 11, 2022
This doesn't really need to be portable, just call session functions
Reduce state timeouts to 10 seconds, but leave at 30 for the initial
Init state when receiving to give the user time to choose a file to
Fix IAC escaping on the way out.
We're doing IAC escaping in the zmodem code, so just move data
directly into node buffer. Also, avoid memmoving on each read since
the buffer will often have more than one byte in it, just use an
offset into ibuf and only memmove when it's over half full.
Since our output and input functions will bypass the telnet code that
escapes or unescapes IACs, add an option to do it here before
interfacing with the send/recv routines.
Interoperability testing with SyncTERM showed that it was too eager
to timeout when we didn't respond fast enough in acceping uploaded
data and writing it, so disable overlapping I/O. This way it won't
send more data to us until we've acked it.
Amendments on July 7, 2022
The UpdateCRC32 macro needed explicit casting to fix hash generation
Amendments on July 4, 2022
Lots of internal restructuring by me to keep all state within a
zmodem_session object with callbacks to network/modem functions to
actually do the data sending and receiving.
Amendments on June 30, 2022