[core] Fix highway uploading

This commit is contained in:
Karlatemp 2022-08-09 21:44:50 +08:00
parent 2df0fc2e4d
commit c685a77c68
No known key found for this signature in database
GPG Key ID: BA173CA2B9956C59

View File

@ -36,7 +36,7 @@ internal class ChunkedFlowSession<T>(
withUse { withUse {
while (true) { while (true) {
val size = runBIO { input.readAvailable(buffer) } val size = runBIO { input.readAvailable(buffer) }
if (size == -1) return if (size <= 0) return
block(mapper(buffer, size, offset.getAndAdd(size.toLongUnsigned()))) block(mapper(buffer, size, offset.getAndAdd(size.toLongUnsigned())))
callback?.onProgression(offset.value) callback?.onProgression(offset.value)
} }