Commit b38f8252 authored by Him188's avatar Him188

Fix expcetion when length=0

parent 5c68fc53
......@@ -276,6 +276,11 @@ internal class QQAndroidBotNetworkHandler(bot: QQAndroidBot) : BotNetworkHandler
while (rawInput.remaining >= length) {
parsePacketAsync(rawInput.readPacket(length))
if (rawInput.remaining == 0L) {
cachedPacket.value = null // 表示包长度正好
cachedPacketTimeoutJob?.cancel()
return
}
length = rawInput.readInt() - 4
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment