[local_ads] set network timeout to 5 seconds

This commit is contained in:
Arsentiy Milchakov 2018-03-02 16:13:18 +03:00 committed by Aleksandr Zatsepin
parent 5c3ffdbbf9
commit a03dea3087
2 changed files with 2 additions and 0 deletions

View file

@ -356,6 +356,7 @@ void Statistics::SendToServer()
ASSERT(!bytes.empty(), ());
platform::HttpClient request(url);
request.SetTimeout(5); // timeout in seconds
#ifdef DEV_LOCAL_ADS_SERVER
request.LoadHeaders(true);
request.SetRawHeader("Host", "localads-statistics.maps.me");

View file

@ -368,6 +368,7 @@ bool LocalAdsManager::DownloadCampaign(MwmSet::MwmId const & mwmId, std::vector<
return false;
platform::HttpClient request(url);
request.SetTimeout(5); // timeout in seconds
bool const success = request.RunHttpRequest() && request.ErrorCode() == 200;
if (!success)