aboutsummaryrefslogtreecommitdiff
path: root/src/zenhttp
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2025-11-10 20:25:31 +0100
committerGitHub Enterprise <[email protected]>2025-11-10 20:25:31 +0100
commita82cceca2fd9e63d18b7e2485207bfe6e4c867cd (patch)
treee60dcc0921d2cbf65b1dee6db08a0bddc5c81b58 /src/zenhttp
parentfix parsing of assume http2 from server discovery (#643) (diff)
downloadzen-a82cceca2fd9e63d18b7e2485207bfe6e4c867cd.tar.xz
zen-a82cceca2fd9e63d18b7e2485207bfe6e4c867cd.zip
add `--boost-worker-memory` option to zen builds (#639)
Diffstat (limited to 'src/zenhttp')
-rw-r--r--src/zenhttp/clients/httpclientcpr.cpp2
-rw-r--r--src/zenhttp/include/zenhttp/httpclient.h11
2 files changed, 7 insertions, 6 deletions
diff --git a/src/zenhttp/clients/httpclientcpr.cpp b/src/zenhttp/clients/httpclientcpr.cpp
index 333fd20b0..66a4ce16f 100644
--- a/src/zenhttp/clients/httpclientcpr.cpp
+++ b/src/zenhttp/clients/httpclientcpr.cpp
@@ -979,7 +979,7 @@ CprHttpClient::Download(std::string_view Url, const std::filesystem::path& TempF
std::optional<size_t> ContentLength = ParseInt<size_t>(Header.second);
if (ContentLength.has_value())
{
- if (ContentLength.value() > 1024 * 1024)
+ if (ContentLength.value() > m_ConnectionSettings.MaximumInMemoryDownloadSize)
{
PayloadFile = std::make_unique<detail::TempPayloadFile>();
std::error_code Ec = PayloadFile->Open(TempFolderPath, ContentLength.value());
diff --git a/src/zenhttp/include/zenhttp/httpclient.h b/src/zenhttp/include/zenhttp/httpclient.h
index c9b6d4dee..9a9b74d72 100644
--- a/src/zenhttp/include/zenhttp/httpclient.h
+++ b/src/zenhttp/include/zenhttp/httpclient.h
@@ -52,11 +52,12 @@ struct HttpClientSettings
std::chrono::milliseconds ConnectTimeout{3000};
std::chrono::milliseconds Timeout{};
std::optional<std::function<HttpClientAccessToken()>> AccessTokenProvider;
- bool AssumeHttp2 = false;
- bool AllowResume = false;
- uint8_t RetryCount = 0;
- Oid SessionId = Oid::Zero;
- bool Verbose = false;
+ bool AssumeHttp2 = false;
+ bool AllowResume = false;
+ uint8_t RetryCount = 0;
+ Oid SessionId = Oid::Zero;
+ bool Verbose = false;
+ uint64_t MaximumInMemoryDownloadSize = 1024u * 1024u;
};
class HttpClientError : public std::runtime_error