forked from organicmaps/organicmaps
Fixed local ads deserialization and redundant server requesting
This commit is contained in:
parent
25741e8844
commit
c82aa95601
3 changed files with 5 additions and 4 deletions
|
@ -85,7 +85,7 @@ std::vector<Campaign> Deserialize(std::vector<uint8_t> const & bytes)
|
|||
ArrayByteSource src(bytes.data());
|
||||
auto const version = Read<Version>(src);
|
||||
static_cast<void>(version); // No version dispatching for now.
|
||||
auto const chunksNumber = Read<size_t>(src);
|
||||
auto const chunksNumber = Read<uint64_t>(src);
|
||||
|
||||
auto const featureIds = ReadData<uint32_t>(src, chunksNumber);
|
||||
auto const icons = ReadData<uint16_t>(src, chunksNumber);
|
||||
|
|
|
@ -426,8 +426,8 @@ void Statistics::SendToServer()
|
|||
}
|
||||
else
|
||||
{
|
||||
LOG(LWARNING,
|
||||
("Sending statistics failed:", request.ErrorCode(), it->first.first, it->first.second));
|
||||
LOG(LWARNING, ("Sending statistics failed:", "URL:", url, "Error code:", request.ErrorCode(),
|
||||
it->first.first, it->first.second));
|
||||
++it;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -316,7 +316,8 @@ bool LocalAdsManager::DownloadCampaign(MwmSet::MwmId const & mwmId, std::vector<
|
|||
{
|
||||
std::lock_guard<std::mutex> lock(m_mutex);
|
||||
auto const & countryName = mwmId.GetInfo()->GetCountryName();
|
||||
if (m_campaigns.find(countryName) != m_campaigns.cend())
|
||||
auto const it = m_campaigns.find(countryName);
|
||||
if (it != m_campaigns.cend() && it->second)
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue