summaryrefslogtreecommitdiff
path: root/include/mbgl/storage
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2015-10-15 21:30:21 +0200
committerKonstantin Käfer <mail@kkaefer.com>2015-10-26 15:54:27 +0100
commit6a7334b882a47ca193209f2012843e42aa3ed4e2 (patch)
treef74bf484c4c53efaa657f524f8c8b01211e15b20 /include/mbgl/storage
parent096a3edf39d23fbd4baa134938c16fed4f2e199c (diff)
downloadqtlocation-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 'include/mbgl/storage')
-rw-r--r--include/mbgl/storage/response.hpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/mbgl/storage/response.hpp b/include/mbgl/storage/response.hpp
index e665f177fc..b232cd06f4 100644
--- a/include/mbgl/storage/response.hpp
+++ b/include/mbgl/storage/response.hpp
@@ -7,9 +7,13 @@ namespace mbgl {
class Response {
public:
+ bool isExpired() const;
+
+public:
enum Status { Error, Successful, NotFound };
Status status = Error;
+ bool stale = false;
std::string message;
int64_t modified = 0;
int64_t expires = 0;