vendor : update cpp-httplib to 0.44.0 (#22919)
This commit is contained in:
parent
7d442abf5c
commit
838374375c
@@ -5,7 +5,7 @@ import os
|
|||||||
import sys
|
import sys
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
HTTPLIB_VERSION = "refs/tags/v0.43.4"
|
HTTPLIB_VERSION = "refs/tags/v0.44.0"
|
||||||
|
|
||||||
vendor = {
|
vendor = {
|
||||||
"https://github.com/nlohmann/json/releases/latest/download/json.hpp": "vendor/nlohmann/json.hpp",
|
"https://github.com/nlohmann/json/releases/latest/download/json.hpp": "vendor/nlohmann/json.hpp",
|
||||||
|
|||||||
Vendored
+24
-5
@@ -1161,12 +1161,11 @@ bool parse_header(const char *beg, const char *end, T fn) {
|
|||||||
|
|
||||||
if (!detail::fields::is_field_value(val)) { return false; }
|
if (!detail::fields::is_field_value(val)) { return false; }
|
||||||
|
|
||||||
if (case_ignore::equal(key, "Location") ||
|
// RFC 9110 §5.5: header field values are opaque octets and MUST NOT be
|
||||||
case_ignore::equal(key, "Referer")) {
|
// percent-decoded by the recipient. Applications that need to interpret a
|
||||||
|
// value as a URI component should call httplib::decode_uri_component()
|
||||||
|
// (or decode_path_component()) explicitly.
|
||||||
fn(key, val);
|
fn(key, val);
|
||||||
} else {
|
|
||||||
fn(key, decode_path_component(val));
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -6192,9 +6191,29 @@ ThreadPool::ThreadPool(size_t n, size_t max_n, size_t mqr)
|
|||||||
#endif
|
#endif
|
||||||
max_thread_count_ = max_n == 0 ? n : max_n;
|
max_thread_count_ = max_n == 0 ? n : max_n;
|
||||||
threads_.reserve(base_thread_count_);
|
threads_.reserve(base_thread_count_);
|
||||||
|
#ifndef CPPHTTPLIB_NO_EXCEPTIONS
|
||||||
|
try {
|
||||||
|
#endif
|
||||||
for (size_t i = 0; i < base_thread_count_; i++) {
|
for (size_t i = 0; i < base_thread_count_; i++) {
|
||||||
threads_.emplace_back(std::thread([this]() { worker(false); }));
|
threads_.emplace_back(std::thread([this]() { worker(false); }));
|
||||||
}
|
}
|
||||||
|
#ifndef CPPHTTPLIB_NO_EXCEPTIONS
|
||||||
|
} catch (...) {
|
||||||
|
// If thread creation fails partway (e.g., pthread_create returns EAGAIN),
|
||||||
|
// signal the workers we already spawned to exit and join them so the
|
||||||
|
// vector destructor does not see joinable threads (which would call
|
||||||
|
// std::terminate). Then rethrow so the caller learns of the failure.
|
||||||
|
{
|
||||||
|
std::unique_lock<std::mutex> lock(mutex_);
|
||||||
|
shutdown_ = true;
|
||||||
|
}
|
||||||
|
cond_.notify_all();
|
||||||
|
for (auto &t : threads_) {
|
||||||
|
if (t.joinable()) { t.join(); }
|
||||||
|
}
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ThreadPool::enqueue(std::function<void()> fn) {
|
bool ThreadPool::enqueue(std::function<void()> fn) {
|
||||||
|
|||||||
Vendored
+2
-2
@@ -8,8 +8,8 @@
|
|||||||
#ifndef CPPHTTPLIB_HTTPLIB_H
|
#ifndef CPPHTTPLIB_HTTPLIB_H
|
||||||
#define CPPHTTPLIB_HTTPLIB_H
|
#define CPPHTTPLIB_HTTPLIB_H
|
||||||
|
|
||||||
#define CPPHTTPLIB_VERSION "0.43.4"
|
#define CPPHTTPLIB_VERSION "0.44.0"
|
||||||
#define CPPHTTPLIB_VERSION_NUM "0x002b04"
|
#define CPPHTTPLIB_VERSION_NUM "0x002c00"
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#if defined(_WIN32_WINNT) && _WIN32_WINNT < 0x0A00
|
#if defined(_WIN32_WINNT) && _WIN32_WINNT < 0x0A00
|
||||||
|
|||||||
Reference in New Issue
Block a user