diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2015-10-15 21:30:21 +0200 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2015-10-26 15:54:27 +0100 |
commit | 6a7334b882a47ca193209f2012843e42aa3ed4e2 (patch) | |
tree | f74bf484c4c53efaa657f524f8c8b01211e15b20 /src/mbgl/text | |
parent | 096a3edf39d23fbd4baa134938c16fed4f2e199c (diff) | |
download | qtlocation-mapboxgl-6a7334b882a47ca193209f2012843e42aa3ed4e2.tar.gz |
[core] add support for stale responses
We're now returning stale responses from cache. Those responses will have the `stale` flag set to true. Currently, all requesters in the core code discard stale responses, and cancel the request immediately after they got a non-stale response.
Diffstat (limited to 'src/mbgl/text')
-rw-r--r-- | src/mbgl/text/glyph_pbf.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/mbgl/text/glyph_pbf.cpp b/src/mbgl/text/glyph_pbf.cpp index e37e656d91..f351e66c2a 100644 --- a/src/mbgl/text/glyph_pbf.cpp +++ b/src/mbgl/text/glyph_pbf.cpp @@ -75,6 +75,10 @@ GlyphPBF::GlyphPBF(GlyphStore* store, }); auto requestCallback = [this, store, fontStack, url](const Response &res) { + if (res.stale) { + // Only handle fresh responses. + return; + } req = nullptr; if (res.status != Response::Successful) { |