mirror of
https://github.com/kiwix/libkiwix.git
synced 2026-01-17 10:48:13 -05:00
Compare commits
8 Commits
feature/ip
...
14.0.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
20abebd623 | ||
|
|
58a1af85b9 | ||
|
|
585f55d885 | ||
|
|
8b00c2eb22 | ||
|
|
c8bddd6cf4 | ||
|
|
5d1b6274a8 | ||
|
|
0de9bd0a99 | ||
|
|
b62274efdd |
3
.github/workflows/ci.yml
vendored
3
.github/workflows/ci.yml
vendored
@@ -38,9 +38,6 @@ jobs:
|
||||
- name: Install packages
|
||||
run: |
|
||||
brew update
|
||||
brew unlink python3
|
||||
# upgrade from python@3.12 to python@3.12.2 fails to overwrite those
|
||||
rm -f /usr/local/bin/2to3 /usr/local/bin/2to3-3.12 /usr/local/bin/idle3 /usr/local/bin/idle3.12 /usr/local/bin/pydoc3 /usr/local/bin/pydoc3.12 /usr/local/bin/python3 /usr/local/bin/python3-config /usr/local/bin/python3.12 /usr/local/bin/python3.12-config
|
||||
brew install pkg-config ninja meson
|
||||
env:
|
||||
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1
|
||||
|
||||
@@ -515,28 +515,7 @@ bool InternalServer::start() {
|
||||
struct sockaddr* sockaddr = (m_ipMode==IpMode::ALL || m_ipMode==IpMode::IPV6)
|
||||
? (struct sockaddr*)&sockAddr6
|
||||
: (struct sockaddr*)&sockAddr4;
|
||||
#ifdef _WIN32
|
||||
SOCKET sock = INVALID_SOCKET;
|
||||
if (m_ipMode == IpMode::ALL || m_ipMode == IpMode::IPV6) {
|
||||
if ((sock = socket(AF_INET6, SOCK_STREAM, 0)) == INVALID_SOCKET) {
|
||||
std::cerr << "ERROR: Failed to create IPv6 socket" << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
int opt = 0;
|
||||
if (setsockopt(sock, IPPROTO_IPV6, IPV6_V6ONLY, (char*)&opt, sizeof(opt)) != 0) {
|
||||
std::cerr << "ERROR: Failed to set IPV6_V6ONLY option" << std::endl;
|
||||
closesocket(sock);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (::bind(sock, (struct sockaddr*)&sockAddr6, sizeof(sockAddr6)) == SOCKET_ERROR) {
|
||||
std::cerr << "ERROR: Failed to bind IPv6 socket" << std::endl;
|
||||
closesocket(sock);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
mp_daemon = MHD_start_daemon(flags,
|
||||
m_port,
|
||||
NULL,
|
||||
@@ -544,21 +523,14 @@ bool InternalServer::start() {
|
||||
&staticHandlerCallback,
|
||||
this,
|
||||
MHD_OPTION_SOCK_ADDR, sockaddr,
|
||||
#ifdef _WIN32
|
||||
(sock == INVALID_SOCKET) ? MHD_OPTION_END : MHD_OPTION_LISTEN_SOCKET, sock,
|
||||
#endif
|
||||
MHD_OPTION_THREAD_POOL_SIZE, m_nbThreads,
|
||||
MHD_OPTION_PER_IP_CONNECTION_LIMIT, m_ipConnectionLimit,
|
||||
MHD_OPTION_END);
|
||||
|
||||
if (mp_daemon == nullptr) {
|
||||
std::cerr << "ERROR: Unable to instantiate the HTTP daemon. The port " << m_port
|
||||
<< " may already be in use, or more permissions are required to open it. "
|
||||
std::cerr << "Unable to instantiate the HTTP daemon. The port " << m_port
|
||||
<< " is maybe already occupied or need more permissions to be open. "
|
||||
"Please try as root or with a port number higher or equal to 1024."
|
||||
<< std::endl;
|
||||
#ifdef _WIN32
|
||||
if (sock != INVALID_SOCKET) closesocket(sock);
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
auto server_start_time = std::chrono::system_clock::now().time_since_epoch();
|
||||
|
||||
@@ -229,7 +229,7 @@ IpAddress getBestPublicIps() {
|
||||
}
|
||||
}
|
||||
#endif
|
||||
const char* const v4prefixes[] = { "192.168", "172.16", "10.0", "169.254" };
|
||||
const char* const v4prefixes[] = { "192.168", "172.16", "10.0" };
|
||||
for (const auto& prefix : v4prefixes) {
|
||||
for (const auto& kv : interfaces) {
|
||||
const auto& interfaceIps = kv.second;
|
||||
|
||||
@@ -60,5 +60,15 @@
|
||||
"download-links-heading": "Discargar ligamines pro <b><i>{{BOOK_TITLE}}</i></b>",
|
||||
"download-links-title": "Discargar libro",
|
||||
"preview-book": "Previsualisation",
|
||||
"unknown-error": "Error incognite"
|
||||
"unknown-error": "Error incognite",
|
||||
"book-category.wikibooks": "Wikilibros",
|
||||
"book-category.wikinews": "Wikinovas",
|
||||
"book-category.wikipedia": "Wikipedia",
|
||||
"book-category.wikiquote": "Wikiquote",
|
||||
"book-category.wikisource": "Wikisource",
|
||||
"book-category.wikispecies": "Wikispecies",
|
||||
"book-category.wikiversity": "Wikiversitate",
|
||||
"book-category.wikivoyage": "Wikiviage",
|
||||
"book-category.wiktionary": "Wiktionario",
|
||||
"book-category.other": "Altere"
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
"no-book-found": "没有符合搜索要求的图书",
|
||||
"url-not-found": "在此服务器上找不到请求的 URL:{{url}}",
|
||||
"suggest-search": "对<a href=\"{{{SEARCH_URL}}}\">{{PATTERN}}</a>进行全文搜索",
|
||||
"random-article-failure": "抱歉! 随机条目失败了 (〒﹏〒) 【好生草的表情(】",
|
||||
"random-article-failure": "抱歉! 随机条目失败了 (〒﹏〒)",
|
||||
"invalid-raw-data-type": "{{DATATYPE}} 对原请求无效。",
|
||||
"invalid-request": "请求的URL无效:{{{url}}}",
|
||||
"no-value-for-arg": "参数{{ARGUMENT}}无值",
|
||||
|
||||
Reference in New Issue
Block a user