AmendHub

Download:

jcs

/

subtext

/

amendments

/

401

zmodem: Increase timeout to 20 seconds, use Time


jcs made amendment 401 about 1 year ago
--- zmodem.c Wed Mar 1 23:16:00 2023 +++ zmodem.c Sun Mar 12 20:52:53 2023 @@ -41,6 +41,8 @@ /* #define ZMODEM_DEBUG */ +#define ZMODEM_TIMEOUT 20 + #ifdef ZMODEM_DEBUG #include "logger.h" extern struct logger *logger; @@ -339,13 +341,13 @@ ZPutHex(struct zmodem_session *zs, short *i, unsigned void ZResetTimeout(struct zmodem_session *zs, short seconds) { - zs->TimeOutAt = time(NULL) + seconds; + zs->TimeOutAt = Time + seconds; } bool ZHaveTimedOut(struct zmodem_session *zs) { - if (zs->TimeOutAt && time(NULL) >= zs->TimeOutAt) + if (zs->TimeOutAt && Time >= zs->TimeOutAt) return true; return false; @@ -797,7 +799,7 @@ ZInit(struct zmodem_session *zs) if (zs->MaxDataLen > ZMODEM_BLOCK_SIZE) zs->MaxDataLen = ZMODEM_BLOCK_SIZE; - zs->TimeOut = 10; + zs->TimeOut = ZMODEM_TIMEOUT; ZResetTimeout(zs, zs->TimeOut); #ifdef ZMODEM_DEBUG