mirror of
https://github.com/kiwix/libkiwix.git
synced 2025-06-26 10:11:30 +00:00
add ipv6 support to HTTP daemon
This commit is contained in:
@ -62,8 +62,10 @@ namespace kiwix
|
||||
{ m_withTaskbar = withTaskbar; m_withLibraryButton = withLibraryButton; }
|
||||
void setBlockExternalLinks(bool blockExternalLinks)
|
||||
{ m_blockExternalLinks = blockExternalLinks; }
|
||||
void setIPv6(bool ipv6) { m_ipv6 = ipv6; }
|
||||
int getPort();
|
||||
std::string getAddress();
|
||||
bool isAddressIPv6();
|
||||
|
||||
protected:
|
||||
std::shared_ptr<Library> mp_library;
|
||||
@ -78,6 +80,7 @@ namespace kiwix
|
||||
bool m_withTaskbar = true;
|
||||
bool m_withLibraryButton = true;
|
||||
bool m_blockExternalLinks = false;
|
||||
bool m_ipv6 = false;
|
||||
int m_ipConnectionLimit = 0;
|
||||
std::unique_ptr<InternalServer> mp_server;
|
||||
};
|
||||
|
@ -25,6 +25,11 @@
|
||||
#include <map>
|
||||
#include <cstdint>
|
||||
|
||||
struct ip_addr{
|
||||
std::string addr;
|
||||
std::string addr6;
|
||||
};
|
||||
|
||||
namespace kiwix {
|
||||
typedef std::pair<std::string, std::string> LangNameCodePair;
|
||||
typedef std::vector<LangNameCodePair> FeedLanguages;
|
||||
@ -215,16 +220,28 @@ bool fileReadable(const std::string& path);
|
||||
*/
|
||||
std::string getMimeTypeForFile(const std::string& filename);
|
||||
|
||||
/** Provides all available network interfaces on Windows
|
||||
*
|
||||
* This function provides the available IPv4 and IPv6 network interfaces
|
||||
*/
|
||||
std::map<std::string,ip_addr> getNetworkInterfacesWin();
|
||||
|
||||
/** Provides all available network interfaces on Posix
|
||||
*
|
||||
* This function provides the available IPv4 and IPv6 network interfaces
|
||||
*/
|
||||
std::map<std::string,ip_addr> getNetworkInterfacesPosix();
|
||||
|
||||
/** Provides all available network interfaces
|
||||
*
|
||||
* This function provides the available IPv4 network interfaces
|
||||
* This function provides the available IPv4 and IPv6 network interfaces
|
||||
*/
|
||||
std::map<std::string, std::string> getNetworkInterfaces();
|
||||
std::map<std::string,ip_addr> getNetworkInterfaces();
|
||||
|
||||
/** Provides the best IP address
|
||||
* This function provides the best IP address from the list given by getNetworkInterfaces
|
||||
*/
|
||||
std::string getBestPublicIp();
|
||||
std::string getBestPublicIp(bool ipv6);
|
||||
|
||||
/** Converts file size to human readable format.
|
||||
*
|
||||
|
Reference in New Issue
Block a user