Skip to content

Commit

Permalink
!fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
sgourdas committed Oct 2, 2024
1 parent 4b40606 commit 4893af3
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/server/kiwix-serve.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 4893af3

Please sign in to comment.