From 5dbe29c8e94deb117b8450922c463a2757c63d45 Mon Sep 17 00:00:00 2001 From: Amos Ng Date: Fri, 12 Jun 2020 00:55:09 +0800 Subject: [PATCH] Shifted closing of pool connections better --- src/main/kotlin/mdnet/base/Application.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/mdnet/base/Application.kt b/src/main/kotlin/mdnet/base/Application.kt index e45c2c8..d270e45 100644 --- a/src/main/kotlin/mdnet/base/Application.kt +++ b/src/main/kotlin/mdnet/base/Application.kt @@ -185,8 +185,8 @@ fun getServer(cache: DiskLruCache, serverSettings: ServerSettings, clientSetting editor.abort() } - mdResponse.close() } + mdResponse.close() respondWithImage(tee, contentLength, contentType, lastModified) } else { editor?.abort() @@ -194,7 +194,7 @@ fun getServer(cache: DiskLruCache, serverSettings: ServerSettings, clientSetting if (LOGGER.isTraceEnabled) { LOGGER.trace("Request for $sanitizedUri is being served") } - + mdResponse.close() respondWithImage(mdResponse.body.stream, contentLength, contentType, lastModified) } }