You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the receiver cannot overlap serial and disk I/O, it uses the
ZRINIT frame to specify a buffer length which the sender will not
overflow. The sending program sends a ZCRCW data subpacket and waits
for a ZACK header before sending the next segment of the file.
If the sending program supports reverse data stream sampling or
interrupt, error recovery will be faster (on average) than a protocol
(such as YMODEM) that sends large blocks.
A sufficiently large receiving buffer allows throughput to closely
approach that of full streaming. For example, 16kb segmented
streaming adds about 3 per cent to full streaming ZMODEM file
transfer times when the round trip delay is five seconds.
If a maximum buffer length is provided in the ZRINIT frame this is read by lsz and stored in the Rxbuflen and blklen variables, but then later when calc_blklen is called the blklen value is overridden (set to 1024) and the Rxbuflen value is never again consulted.
This is problematic for my use case because I trying to use ZMODEM to program small embedded devices which have limited RAM and a specific flash block size which must be programmed. I am trying to set the buffer length to one flash page so that I can read it in, checksum it, and then write it to flash before accepting the next subpacket.
I think the solution to this is to set the start_blklen and max_blklen variables as well when Rxbuflen is set, if it is smaller than Tframelen, exactly the same way that these are set when it is.
The text was updated successfully, but these errors were encountered:
As an addition to this, the following section of code makes it impossible to test this behaviour using pipes to a simulated receiver as it overrides the Rxbuflen value:
Further, the commit fbdffdb breaks the required behaviour further by preventing a ZCRCW request from being made after each Rxbuflen sized block. The comment stating that the newcnt variable was never updated was incorrect. The following code
The relevant section reads:
If a maximum buffer length is provided in the ZRINIT frame this is read by
lsz
and stored in theRxbuflen
andblklen
variables, but then later whencalc_blklen
is called theblklen
value is overridden (set to 1024) and theRxbuflen
value is never again consulted.This is problematic for my use case because I trying to use ZMODEM to program small embedded devices which have limited RAM and a specific flash block size which must be programmed. I am trying to set the buffer length to one flash page so that I can read it in, checksum it, and then write it to flash before accepting the next subpacket.
I think the solution to this is to set the
start_blklen
andmax_blklen
variables as well whenRxbuflen
is set, if it is smaller thanTframelen
, exactly the same way that these are set when it is.The text was updated successfully, but these errors were encountered: