Backward compatible overload of getBestPublicIp()

This commit is contained in:
Veloman Yunkan 2024-06-03 16:12:34 +04:00 committed by Kelson
parent ae4b652fb2
commit 83101679a0
2 changed files with 16 additions and 4 deletions

View File

@ -231,6 +231,12 @@ std::map<std::string,IpAddress> getNetworkInterfaces();
*/ */
std::string getBestPublicIp(bool ipv6); std::string getBestPublicIp(bool ipv6);
/** Provides the best IPv4 adddress
* Equivalent to getBestPublicIp(false). Provided for backward compatibility
* with libkiwix v13.1.0.
*/
std::string getBestPublicIp();
/** Converts file size to human readable format. /** Converts file size to human readable format.
* *
* This function will convert a number to its equivalent size using units. * This function will convert a number to its equivalent size using units.

View File

@ -213,3 +213,9 @@ std::string kiwix::getBestPublicIp(bool ipv6) {
} }
return ipv6 ? bestPublicIp.addr6 : bestPublicIp.addr; return ipv6 ? bestPublicIp.addr6 : bestPublicIp.addr;
} }
std::string kiwix::getBestPublicIp()
{
return getBestPublicIp(false);
}