mirror of
https://github.com/XRPLF/rippled.git
synced 2026-07-30 02:20:39 +00:00
Support shard downloading via HTTP or HTTPS
This commit is contained in:
committed by
Nik Bougalis
parent
a8d481c2a5
commit
2bba79138f
@@ -375,13 +375,17 @@ ShardArchiveHandler::next(std::lock_guard<std::mutex> const& l)
|
||||
// sleeps.
|
||||
auto const& url{archives_.begin()->second};
|
||||
auto wrapper = jobCounter_.wrap([this, url, dstDir](Job&) {
|
||||
auto const ssl = (url.scheme == "https");
|
||||
auto const defaultPort = ssl ? 443 : 80;
|
||||
|
||||
if (!downloader_->download(
|
||||
url.domain,
|
||||
std::to_string(url.port.get_value_or(443)),
|
||||
std::to_string(url.port.get_value_or(defaultPort)),
|
||||
url.path,
|
||||
11,
|
||||
dstDir / "archive.tar.lz4",
|
||||
[this](path dstPath) { complete(dstPath); }))
|
||||
[this](path dstPath) { complete(dstPath); },
|
||||
ssl))
|
||||
{
|
||||
std::lock_guard<std::mutex> l(m_);
|
||||
removeAndProceed(l);
|
||||
|
||||
Reference in New Issue
Block a user