From c685a77c68e44990c9d2f57efbb52d46fb1edb5d Mon Sep 17 00:00:00 2001 From: Karlatemp Date: Tue, 9 Aug 2022 21:44:50 +0800 Subject: [PATCH] [core] Fix highway uploading --- .../src/commonMain/kotlin/network/highway/ChunkedFlowSession.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mirai-core/src/commonMain/kotlin/network/highway/ChunkedFlowSession.kt b/mirai-core/src/commonMain/kotlin/network/highway/ChunkedFlowSession.kt index a35239413..55c487342 100644 --- a/mirai-core/src/commonMain/kotlin/network/highway/ChunkedFlowSession.kt +++ b/mirai-core/src/commonMain/kotlin/network/highway/ChunkedFlowSession.kt @@ -36,7 +36,7 @@ internal class ChunkedFlowSession( withUse { while (true) { val size = runBIO { input.readAvailable(buffer) } - if (size == -1) return + if (size <= 0) return block(mapper(buffer, size, offset.getAndAdd(size.toLongUnsigned()))) callback?.onProgression(offset.value) }