From 4893af3aeb63e318fe3887ce02d90c5ad61ea132 Mon Sep 17 00:00:00 2001 From: sgourdas Date: Wed, 2 Oct 2024 18:43:17 +0300 Subject: [PATCH] !fixup --- src/server/kiwix-serve.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/server/kiwix-serve.cpp b/src/server/kiwix-serve.cpp index 1465fc2f..799cf72f 100644 --- a/src/server/kiwix-serve.cpp +++ b/src/server/kiwix-serve.cpp @@ -324,12 +324,16 @@ int main(int argc, char** argv) auto libraryFileTimestamp = newestFileTimestamp(libraryPaths); auto curLibraryFileTimestamp = libraryFileTimestamp; - kiwix::IpMode ipMode = (address == "all") ? kiwix::IpMode::ALL : - (address == "ipv6") ? kiwix::IpMode::IPV6 : - (address == "ipv4") ? kiwix::IpMode::IPV4 : - kiwix::IpMode::AUTO; - - if(!address.empty() && ipMode != kiwix::IpMode::AUTO) address.clear(); // Clear to indicate that protocol has been provided in address. + if (address == "all") { + address.clear(); + ipMode = kiwix::IpMode::ALL; + } else if (address == "ipv4") { + address.clear(); + ipMode = kiwix::IpMode::IPV4; + } else if (address == "ipv6") { + address.clear(); + ipMode = kiwix::IpMode::IPV6; + } #ifndef _WIN32 /* Fork if necessary */