u2c: fix chunksize calculation

files which were exactly 128 GiB large would fail
(you can't make this shit up)
This commit is contained in:
ed 2024-10-15 22:39:48 +00:00
parent 65a2b6a223
commit a2e037d6af

View file

@ -665,7 +665,7 @@ def up2k_chunksize(filesize):
while True: while True:
for mul in [1, 2]: for mul in [1, 2]:
nchunks = math.ceil(filesize * 1.0 / chunksize) nchunks = math.ceil(filesize * 1.0 / chunksize)
if nchunks <= 256 or (chunksize >= 32 * 1024 * 1024 and nchunks < 4096): if nchunks <= 256 or (chunksize >= 32 * 1024 * 1024 and nchunks <= 4096):
return chunksize return chunksize
chunksize += stepsize chunksize += stepsize