1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2024-12-14 04:00:30 +00:00

Fix large file uploads producing oversized packets.

- Fixes #1026
- The remaining bytes counter wasn't being decremented, so the code that
  splits off smaller packets was unreachable. Thus all file slices were
  being put into a single UploadFileMessage packet.
This commit is contained in:
Toad-Dev 2022-01-23 22:20:14 -08:00
parent cdf8b77ffd
commit 60d1d1bb18

View File

@ -160,6 +160,7 @@ public class UploadFileMessage extends ComputerServerMessage
contents.position( currentOffset ).limit( currentOffset + canWrite ); contents.position( currentOffset ).limit( currentOffset + canWrite );
slices.add( new FileSlice( fileId, currentOffset, contents.slice() ) ); slices.add( new FileSlice( fileId, currentOffset, contents.slice() ) );
currentOffset += canWrite; currentOffset += canWrite;
remaining -= canWrite;
} }
contents.position( 0 ).limit( capacity ); contents.position( 0 ).limit( capacity );