MSX
MSX copied to clipboard
HGET: Issues downloading files less than 100 bytes
- For files [25..99] bytes: The progress bar will overflow the 25 chars.
- For files [1..24] bytes The 'blockSize' become 0 and progress bar loop is infinite until Ctrl+C.
https://github.com/Konamiman/MSX/blob/758d649b55f83421045f2fb39e25363c43d1969f/SRC/NETWORK/hget.c#L1425 https://github.com/Konamiman/MSX/blob/758d649b55f83421045f2fb39e25363c43d1969f/SRC/NETWORK/hget.c#L1448
Adding line:
if (!blockSize) blockSize++;
After every blockSize asigment must prevent the hang up for files below 25 bytes.
But progress bar issue persist for files 99 bytes and [1..24] bytes length (tested only with 24, 25, 99, 100 bytes files).
I posted the final bugfix code at pastebin, feel free to modify or optimize my proposal as you wish.