From fde00ecb7fa73ef53395a70ddf494da3988cc852 Mon Sep 17 00:00:00 2001 From: carbotaniuman <41451839+carbotaniuman@users.noreply.github.com> Date: Sat, 4 Jul 2020 12:11:24 -0500 Subject: [PATCH] Fix stupid bug --- src/main/kotlin/mdnet/base/server/ImageServer.kt | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/main/kotlin/mdnet/base/server/ImageServer.kt b/src/main/kotlin/mdnet/base/server/ImageServer.kt index ae97632..93af258 100644 --- a/src/main/kotlin/mdnet/base/server/ImageServer.kt +++ b/src/main/kotlin/mdnet/base/server/ImageServer.kt @@ -82,13 +82,11 @@ class ImageServer(private val cache: DiskLruCache, private val statistics: Atomi .setConnectTimeout(3000) .setSocketTimeout(3000) .setConnectionRequestTimeout(3000) - .setLocalAddress( + .apply { if (clientHostname != "0.0.0.0") { - InetAddress.getByName(clientHostname) - } else { - InetAddress.getLocalHost() + setLocalAddress(InetAddress.getByName(clientHostname)) } - ) + } .build()) .setMaxConnTotal(THREADS_TO_ALLOCATE) .setMaxConnPerRoute(THREADS_TO_ALLOCATE)