Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/map
diff options
context:
space:
mode:
authorSergey Yershov <syershov@maps.me>2016-12-07 17:38:47 +0300
committerSergey Yershov <syershov@maps.me>2016-12-09 13:39:57 +0300
commitd67c82407eee4f8b5f7ad1c493497476d83c4529 (patch)
treebab0d31bce50df147b56fdf96d77fb40b08a648b /map
parentfc8189106a38692a746597ebb9548bbcd218068e (diff)
HEAD request for check traffic update
Diffstat (limited to 'map')
-rw-r--r--map/traffic_manager.cpp6
-rw-r--r--map/traffic_manager.hpp5
2 files changed, 10 insertions, 1 deletions
diff --git a/map/traffic_manager.cpp b/map/traffic_manager.cpp
index 4249316603..4e004245e3 100644
--- a/map/traffic_manager.cpp
+++ b/map/traffic_manager.cpp
@@ -227,9 +227,13 @@ void TrafficManager::ThreadRoutine()
{
for (auto const & mwm : mwms)
{
+ auto const & mwmInfo = mwm.GetInfo();
+ if (!mwmInfo)
+ continue;
+
traffic::TrafficInfo info(mwm, m_currentDataVersion);
- if (info.ReceiveTrafficData())
+ if (info.ReceiveTrafficData(m_trafficETags[mwm]))
{
OnTrafficDataResponse(move(info));
}
diff --git a/map/traffic_manager.hpp b/map/traffic_manager.hpp
index cf53d3091f..82a913535f 100644
--- a/map/traffic_manager.hpp
+++ b/map/traffic_manager.hpp
@@ -20,6 +20,7 @@
#include "std/map.hpp"
#include "std/mutex.hpp"
#include "std/set.hpp"
+#include "std/string.hpp"
#include "std/vector.hpp"
namespace df
@@ -141,6 +142,10 @@ private:
vector<MwmSet::MwmId> m_lastMwmsByRect;
set<MwmSet::MwmId> m_activeMwms;
+ // The ETag or entity tag is part of HTTP, the protocol for the World Wide Web.
+ // It is one of several mechanisms that HTTP provides for web cache validation,
+ // which allows a client to make conditional requests.
+ map<MwmSet::MwmId, string> m_trafficETags;
vector<MwmSet::MwmId> m_requestedMwms;
mutex m_mutex;