summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/other_tools/just_mr/main.cpp2
-rw-r--r--src/other_tools/ops_maps/content_cas_map.cpp19
-rw-r--r--src/other_tools/ops_maps/content_cas_map.hpp1
3 files changed, 14 insertions, 8 deletions
diff --git a/src/other_tools/just_mr/main.cpp b/src/other_tools/just_mr/main.cpp
index 52cfe09a..787483ba 100644
--- a/src/other_tools/just_mr/main.cpp
+++ b/src/other_tools/just_mr/main.cpp
@@ -794,6 +794,7 @@ void DefaultReachableRepositories(
// create async maps
auto content_cas_map = CreateContentCASMap(arguments.common.just_mr_paths,
+ arguments.common.ca_info,
arguments.common.jobs);
auto repo_fetch_map =
CreateRepoFetchMap(&content_cas_map, *fetch_dir, arguments.common.jobs);
@@ -1118,6 +1119,7 @@ void DefaultReachableRepositories(
auto crit_git_op_ptr = std::make_shared<CriticalGitOpGuard>();
auto critical_git_op_map = CreateCriticalGitOpMap(crit_git_op_ptr);
auto content_cas_map = CreateContentCASMap(arguments.common.just_mr_paths,
+ arguments.common.ca_info,
arguments.common.jobs);
auto import_to_git_map =
CreateImportToGitMap(&critical_git_op_map, arguments.common.jobs);
diff --git a/src/other_tools/ops_maps/content_cas_map.cpp b/src/other_tools/ops_maps/content_cas_map.cpp
index f9b16588..5b692026 100644
--- a/src/other_tools/ops_maps/content_cas_map.cpp
+++ b/src/other_tools/ops_maps/content_cas_map.cpp
@@ -25,9 +25,11 @@ namespace {
/// \brief Fetches a file from the internet and stores its content in memory.
/// Returns the content.
-[[nodiscard]] auto NetworkFetch(std::string const& fetch_url) noexcept
+[[nodiscard]] auto NetworkFetch(std::string const& fetch_url,
+ JustMR::CAInfoPtr const& ca_info) noexcept
-> std::optional<std::string> {
- auto curl_handle = CurlEasyHandle::Create();
+ auto curl_handle =
+ CurlEasyHandle::Create(ca_info->no_ssl_verify, ca_info->ca_bundle);
if (not curl_handle) {
return std::nullopt;
}
@@ -46,12 +48,13 @@ template <Hasher::HashType type>
} // namespace
auto CreateContentCASMap(JustMR::PathsPtr const& just_mr_paths,
+ JustMR::CAInfoPtr const& ca_info,
std::size_t jobs) -> ContentCASMap {
- auto ensure_in_cas = [just_mr_paths](auto /*unused*/,
- auto setter,
- auto logger,
- auto /*unused*/,
- auto const& key) {
+ auto ensure_in_cas = [just_mr_paths, ca_info](auto /*unused*/,
+ auto setter,
+ auto logger,
+ auto /*unused*/,
+ auto const& key) {
// start work reporting, but only if part of a distdir
if (key.origin_from_distdir) {
JustMRProgress::Instance().TaskTracker().Start(key.origin);
@@ -83,7 +86,7 @@ auto CreateContentCASMap(JustMR::PathsPtr const& just_mr_paths,
return;
}
// now do the actual fetch
- auto data = NetworkFetch(key.fetch_url);
+ auto data = NetworkFetch(key.fetch_url, ca_info);
if (data == std::nullopt) {
(*logger)(fmt::format("Failed to fetch a file with id {} from {}",
key.content,
diff --git a/src/other_tools/ops_maps/content_cas_map.hpp b/src/other_tools/ops_maps/content_cas_map.hpp
index 895aa518..a490b34a 100644
--- a/src/other_tools/ops_maps/content_cas_map.hpp
+++ b/src/other_tools/ops_maps/content_cas_map.hpp
@@ -53,6 +53,7 @@ struct ArchiveRepoInfo {
using ContentCASMap = AsyncMapConsumer<ArchiveContent, bool>;
[[nodiscard]] auto CreateContentCASMap(JustMR::PathsPtr const& just_mr_paths,
+ JustMR::CAInfoPtr const& ca_info,
std::size_t jobs) -> ContentCASMap;
namespace std {