Fix passing the body limit to nested `cachePackages()` calls
This commit is contained in:
parent
075f539480
commit
1ce736d66f
|
@ -201,7 +201,7 @@ void cachePackages(LogContext &log, std::shared_ptr<PackageCachingSession> &&pac
|
||||||
log(Phrases::InfoMessage, "Downloading \"", cachingData->url, "\" to \"", cachingData->destinationFilePath, "\"\n");
|
log(Phrases::InfoMessage, "Downloading \"", cachingData->url, "\" to \"", cachingData->destinationFilePath, "\"\n");
|
||||||
runSessionFromUrl(
|
runSessionFromUrl(
|
||||||
packageCachingSession->ioContext(), packageCachingSession->m_sslContext, cachingData->url,
|
packageCachingSession->ioContext(), packageCachingSession->m_sslContext, cachingData->url,
|
||||||
[&log, packageCachingSession, cachingData](Session &session, const WebClient::HttpClientError &error) mutable {
|
[&log, bodyLimit, packageCachingSession, cachingData](Session &session, const WebClient::HttpClientError &error) mutable {
|
||||||
if (error.errorCode != boost::beast::errc::success && error.errorCode != boost::asio::ssl::error::stream_truncated) {
|
if (error.errorCode != boost::beast::errc::success && error.errorCode != boost::asio::ssl::error::stream_truncated) {
|
||||||
const auto msg = std::make_tuple(
|
const auto msg = std::make_tuple(
|
||||||
"Error downloading \"", cachingData->url, "\" to \"", cachingData->destinationFilePath, "\": ", error.what());
|
"Error downloading \"", cachingData->url, "\" to \"", cachingData->destinationFilePath, "\": ", error.what());
|
||||||
|
@ -216,7 +216,7 @@ void cachePackages(LogContext &log, std::shared_ptr<PackageCachingSession> &&pac
|
||||||
cachingData->error = tupleToString(msg);
|
cachingData->error = tupleToString(msg);
|
||||||
log(Phrases::ErrorMessage, msg, '\n');
|
log(Phrases::ErrorMessage, msg, '\n');
|
||||||
}
|
}
|
||||||
cachePackages(log, std::move(packageCachingSession), 1);
|
cachePackages(log, std::move(packageCachingSession), bodyLimit, 1);
|
||||||
},
|
},
|
||||||
std::string(cachingData->destinationFilePath), std::string_view(), std::string_view(), boost::beast::http::verb::get, bodyLimit);
|
std::string(cachingData->destinationFilePath), std::string_view(), std::string_view(), boost::beast::http::verb::get, bodyLimit);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue