diff --git a/storage/map_files_downloader.cpp b/storage/map_files_downloader.cpp index 7775533c70..754de2667e 100644 --- a/storage/map_files_downloader.cpp +++ b/storage/map_files_downloader.cpp @@ -77,11 +77,19 @@ void MapFilesDownloader::SetServersList(ServersList const & serversList) m_serversList = serversList; } +void MapFilesDownloader::SetDiffs(diffs::NameDiffInfoMap const & diffs) +{ + m_diffs = diffs; +} + // static MapFilesDownloader::ServersList MapFilesDownloader::LoadServersList() { + auto constexpr kTimeoutInSeconds = 10.0; + platform::HttpClient request(GetPlatform().MetaServerUrl()); std::string httpResult; + request.SetTimeout(kTimeoutInSeconds); request.RunHttpRequest(httpResult); std::vector urls; downloader::GetServersList(httpResult, urls); diff --git a/storage/map_files_downloader.hpp b/storage/map_files_downloader.hpp index b2dd5577a5..642df0f19b 100644 --- a/storage/map_files_downloader.hpp +++ b/storage/map_files_downloader.hpp @@ -1,5 +1,7 @@ #pragma once +#include "storage/diff_scheme/diff_types.hpp" + #include "platform/http_request.hpp" #include "platform/safe_callback.hpp" @@ -50,6 +52,7 @@ public: int64_t dataVersion); void SetServersList(ServersList const & serversList); + void SetDiffs(diffs::NameDiffInfoMap const & diffs); protected: // Synchronously loads list of servers by http client. @@ -65,5 +68,6 @@ private: DownloadingProgressCallback const & onProgress) = 0; ServersList m_serversList; + diffs::NameDiffInfoMap m_diffs; }; } // namespace storage diff --git a/storage/storage.cpp b/storage/storage.cpp index 994eccfcc8..1131677330 100644 --- a/storage/storage.cpp +++ b/storage/storage.cpp @@ -1642,6 +1642,7 @@ void Storage::SetStartDownloadingCallback(StartDownloadingCallback const & cb) void Storage::OnDiffStatusReceived(diffs::NameDiffInfoMap && diffs) { + m_downloader->SetDiffs(diffs); m_diffManager.Load(move(diffs)); if (m_diffManager.GetStatus() != diffs::Status::NotAvailable) {