AmendHub

jcs

/

subtext

/

amendments

/

zmodem.c

Amendments on May 1, 2023

zmodem: Set ZP0 to something in ZRINIT

When left at zero, the sender may just send us way more data than we
can handle and it'll timeout. By sending a reasonble block size, the
sender will have to wait for us to ACK along the way.
Fixes NetRunner 2.0B21, also tested with SyncTERM.
jcs made amendment 502 about 1 year ago

Amendments on March 13, 2023

zmodem: Increase timeout to 20 seconds, use Time

jcs made amendment 401 about 1 year ago

Amendments on March 2, 2023

zmodem: Handle malloc failure

jcs made amendment 351 about 1 year ago

Amendments on November 7, 2022

zmodem: Fix compilation with ZMODEM_DEBUG enabled

jcs made amendment 270 about 1 year ago

Amendments on November 6, 2022

zmodem: Make our own copy of upload path in ZCreateReceiver

We were not owning this string, so in ZDestroy we were free()ing a
pointer behind the caller's back.
jcs made amendment 268 about 1 year ago

Amendments on July 31, 2022

*: Add malloc annotations

jcs made amendment 226 over 2 years ago

Amendments on July 21, 2022

*: Use NewPtr instead of malloc, add malloc and free debugging

Instead of free(ptr), use xfree(&ptr) and after it calls
DisposePtr(ptr), it will update ptr to point at NULL to catch
use-after-frees.
When MALLOC_DEBUG is defined, each allocation is added to a
list, and removed when freed. If it's not in the list at free
time, it's a double-free. Also, instead of pointing pointers at
NULL, point them to a pre-defined block of zeroes and in the
idle loop, periodically check that this block is still zero. This
will also catch use-after-frees in a more reliable (but costly)
way.
jcs made amendment 220 over 2 years ago

Amendments on July 11, 2022

zmodem: Bug fixes, remove send/recv abstraction

This doesn't really need to be portable, just call session functions
directly.
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
send us.
Fix IAC escaping on the way out.
jcs made amendment 189 over 2 years ago

zmodem: Improve debug logging, do 32-bit CRC, disable overlapping I/O

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.
jcs made amendment 186 over 2 years ago

Amendments on July 4, 2022

zmodem: Add BSD-licensed ZMODEM implementation from TeraTerm

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.
jcs made amendment 182 over 2 years ago