MSX icon indicating copy to clipboard operation
MSX copied to clipboard

HGET: Issues downloading files less than 100 bytes

Open nataliapc opened this issue 1 year ago • 2 comments

  • 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

nataliapc avatar Aug 15 '24 13:08 nataliapc

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).

nataliapc avatar Aug 15 '24 16:08 nataliapc

I posted the final bugfix code at pastebin, feel free to modify or optimize my proposal as you wish.

Pastebin diff code

nataliapc avatar Aug 15 '24 17:08 nataliapc