mirror of
https://github.com/ggml-org/llama.cpp.git
synced 2026-06-09 07:16:44 +02:00
vendor : update cpp-httplib to 0.43.4 (#22888)
This commit is contained in:
committed by
GitHub
parent
2b2babd124
commit
5d5d2e15d2
@@ -5,7 +5,7 @@ import os
|
||||
import sys
|
||||
import subprocess
|
||||
|
||||
HTTPLIB_VERSION = "refs/tags/v0.43.3"
|
||||
HTTPLIB_VERSION = "refs/tags/v0.43.4"
|
||||
|
||||
vendor = {
|
||||
"https://github.com/nlohmann/json/releases/latest/download/json.hpp": "vendor/nlohmann/json.hpp",
|
||||
|
||||
Vendored
+17
-5
@@ -8980,10 +8980,22 @@ ssize_t ChunkedDecoder::read_payload(char *buf, size_t len,
|
||||
stream_line_reader lr(strm, line_buf, sizeof(line_buf));
|
||||
if (!lr.getline()) { return -1; }
|
||||
|
||||
char *endptr = nullptr;
|
||||
unsigned long chunk_len = std::strtoul(lr.ptr(), &endptr, 16);
|
||||
if (endptr == lr.ptr()) { return -1; }
|
||||
if (chunk_len == ULONG_MAX) { return -1; }
|
||||
// RFC 9112 §7.1: chunk-size = 1*HEXDIG
|
||||
const char *p = lr.ptr();
|
||||
int v = 0;
|
||||
if (!is_hex(*p, v)) { return -1; }
|
||||
|
||||
size_t chunk_len = 0;
|
||||
constexpr size_t chunk_len_max = (std::numeric_limits<size_t>::max)();
|
||||
for (; is_hex(*p, v); ++p) {
|
||||
if (chunk_len > (chunk_len_max >> 4)) { return -1; }
|
||||
chunk_len = (chunk_len << 4) | static_cast<size_t>(v);
|
||||
}
|
||||
|
||||
while (is_space_or_tab(*p)) {
|
||||
++p;
|
||||
}
|
||||
if (*p != '\0' && *p != ';' && *p != '\r' && *p != '\n') { return -1; }
|
||||
|
||||
if (chunk_len == 0) {
|
||||
chunk_remaining = 0;
|
||||
@@ -8993,7 +9005,7 @@ ssize_t ChunkedDecoder::read_payload(char *buf, size_t len,
|
||||
return 0;
|
||||
}
|
||||
|
||||
chunk_remaining = static_cast<size_t>(chunk_len);
|
||||
chunk_remaining = chunk_len;
|
||||
last_chunk_total = chunk_remaining;
|
||||
last_chunk_offset = 0;
|
||||
}
|
||||
|
||||
Vendored
+2
-2
@@ -8,8 +8,8 @@
|
||||
#ifndef CPPHTTPLIB_HTTPLIB_H
|
||||
#define CPPHTTPLIB_HTTPLIB_H
|
||||
|
||||
#define CPPHTTPLIB_VERSION "0.43.3"
|
||||
#define CPPHTTPLIB_VERSION_NUM "0x002b03"
|
||||
#define CPPHTTPLIB_VERSION "0.43.4"
|
||||
#define CPPHTTPLIB_VERSION_NUM "0x002b04"
|
||||
|
||||
#ifdef _WIN32
|
||||
#if defined(_WIN32_WINNT) && _WIN32_WINNT < 0x0A00
|
||||
|
||||
Reference in New Issue
Block a user