vendor : update cpp-httplib to 0.37.1 (#20390)
This commit is contained in:
committed by
GitHub
parent
0e810413bb
commit
557fe2d913
@@ -5,7 +5,7 @@ import os
|
|||||||
import sys
|
import sys
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
HTTPLIB_VERSION = "refs/tags/v0.37.0"
|
HTTPLIB_VERSION = "refs/tags/v0.37.1"
|
||||||
|
|
||||||
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
+12
-5
@@ -4424,7 +4424,8 @@ get_range_offset_and_length(Range r, size_t content_length) {
|
|||||||
assert(r.first <= r.second &&
|
assert(r.first <= r.second &&
|
||||||
r.second < static_cast<ssize_t>(content_length));
|
r.second < static_cast<ssize_t>(content_length));
|
||||||
(void)(content_length);
|
(void)(content_length);
|
||||||
return std::make_pair(r.first, static_cast<size_t>(r.second - r.first) + 1);
|
return std::make_pair(static_cast<size_t>(r.first),
|
||||||
|
static_cast<size_t>(r.second - r.first) + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string make_content_range_header_field(
|
std::string make_content_range_header_field(
|
||||||
@@ -8616,11 +8617,17 @@ ClientImpl::open_stream(const std::string &method, const std::string &path,
|
|||||||
handle.body_reader_.stream = handle.stream_;
|
handle.body_reader_.stream = handle.stream_;
|
||||||
handle.body_reader_.payload_max_length = payload_max_length_;
|
handle.body_reader_.payload_max_length = payload_max_length_;
|
||||||
|
|
||||||
auto content_length_str = handle.response->get_header_value("Content-Length");
|
if (handle.response->has_header("Content-Length")) {
|
||||||
if (!content_length_str.empty()) {
|
bool is_invalid = false;
|
||||||
|
auto content_length = detail::get_header_value_u64(
|
||||||
|
handle.response->headers, "Content-Length", 0, 0, is_invalid);
|
||||||
|
if (is_invalid) {
|
||||||
|
handle.error = Error::Read;
|
||||||
|
handle.response.reset();
|
||||||
|
return handle;
|
||||||
|
}
|
||||||
handle.body_reader_.has_content_length = true;
|
handle.body_reader_.has_content_length = true;
|
||||||
handle.body_reader_.content_length =
|
handle.body_reader_.content_length = content_length;
|
||||||
static_cast<size_t>(std::stoull(content_length_str));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
auto transfer_encoding =
|
auto transfer_encoding =
|
||||||
|
|||||||
Vendored
+3
-23
@@ -8,28 +8,8 @@
|
|||||||
#ifndef CPPHTTPLIB_HTTPLIB_H
|
#ifndef CPPHTTPLIB_HTTPLIB_H
|
||||||
#define CPPHTTPLIB_HTTPLIB_H
|
#define CPPHTTPLIB_HTTPLIB_H
|
||||||
|
|
||||||
#define CPPHTTPLIB_VERSION "0.37.0"
|
#define CPPHTTPLIB_VERSION "0.37.1"
|
||||||
#define CPPHTTPLIB_VERSION_NUM "0x002500"
|
#define CPPHTTPLIB_VERSION_NUM "0x002501"
|
||||||
|
|
||||||
/*
|
|
||||||
* Platform compatibility check
|
|
||||||
*/
|
|
||||||
|
|
||||||
#if defined(_WIN32) && !defined(_WIN64)
|
|
||||||
#if defined(_MSC_VER)
|
|
||||||
#pragma message( \
|
|
||||||
"cpp-httplib doesn't support 32-bit Windows. Please use a 64-bit compiler.")
|
|
||||||
#else
|
|
||||||
#warning \
|
|
||||||
"cpp-httplib doesn't support 32-bit Windows. Please use a 64-bit compiler."
|
|
||||||
#endif
|
|
||||||
#elif defined(__SIZEOF_POINTER__) && __SIZEOF_POINTER__ < 8
|
|
||||||
#warning \
|
|
||||||
"cpp-httplib doesn't support 32-bit platforms. Please use a 64-bit compiler."
|
|
||||||
#elif defined(__SIZEOF_SIZE_T__) && __SIZEOF_SIZE_T__ < 8
|
|
||||||
#warning \
|
|
||||||
"cpp-httplib doesn't support platforms where size_t is less than 64 bits."
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#if defined(_WIN32_WINNT) && _WIN32_WINNT < 0x0A00
|
#if defined(_WIN32_WINNT) && _WIN32_WINNT < 0x0A00
|
||||||
@@ -2797,7 +2777,7 @@ inline size_t get_header_value_u64(const Headers &headers,
|
|||||||
std::advance(it, static_cast<ssize_t>(id));
|
std::advance(it, static_cast<ssize_t>(id));
|
||||||
if (it != rng.second) {
|
if (it != rng.second) {
|
||||||
if (is_numeric(it->second)) {
|
if (is_numeric(it->second)) {
|
||||||
return std::strtoull(it->second.data(), nullptr, 10);
|
return static_cast<size_t>(std::strtoull(it->second.data(), nullptr, 10));
|
||||||
} else {
|
} else {
|
||||||
is_invalid_value = true;
|
is_invalid_value = true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user