From 6a7334b882a47ca193209f2012843e42aa3ed4e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20K=C3=A4fer?= Date: Thu, 15 Oct 2015 21:30:21 +0200 Subject: [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. --- include/mbgl/storage/response.hpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include/mbgl/storage/response.hpp') 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 @@ -6,10 +6,14 @@ 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; -- cgit v1.2.1