From 80a88891064c231c7ba7ed5bf3e956ea6fa0cee7 Mon Sep 17 00:00:00 2001 From: Graham Date: Wed, 13 Jan 2021 17:52:59 +0000 Subject: [PATCH] Call read() if there is any existing in-flight request This fixes the downloader getting stuck if there's a particularly large file, such that we've read all the current inbound data but haven't sent a new request yet as we still have 200 in-flight. Signed-off-by: Graham --- .../main/kotlin/org/openrs2/archive/cache/Js5ChannelHandler.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/archive/src/main/kotlin/org/openrs2/archive/cache/Js5ChannelHandler.kt b/archive/src/main/kotlin/org/openrs2/archive/cache/Js5ChannelHandler.kt index 39b576e64b..31c697f469 100644 --- a/archive/src/main/kotlin/org/openrs2/archive/cache/Js5ChannelHandler.kt +++ b/archive/src/main/kotlin/org/openrs2/archive/cache/Js5ChannelHandler.kt @@ -71,6 +71,9 @@ public class Js5ChannelHandler( if (flush) { ctx.flush() + } + + if (inFlightRequests.isNotEmpty()) { ctx.read() } }