diff options
author | timoreo <contact@timoreo.fr> | 2022-08-11 07:32:43 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-11 07:32:43 +0200 |
commit | 1a5986abe0d9c8e483eaa5f8ee5e8c306478370f (patch) | |
tree | 18cef990e061a003647edb1171db1e60cf8db4a6 /launcher/net/HttpMetaCache.h | |
parent | a5da3db9662a94b601bb203ce75084be522cfa91 (diff) | |
parent | ab6e1b112b05a1fcad962d15c087ed9ae746bf87 (diff) | |
download | PrismLauncher-1a5986abe0d9c8e483eaa5f8ee5e8c306478370f.tar.gz PrismLauncher-1a5986abe0d9c8e483eaa5f8ee5e8c306478370f.tar.bz2 PrismLauncher-1a5986abe0d9c8e483eaa5f8ee5e8c306478370f.zip |
Merge pull request #920 from flowln/metacache_fix
Diffstat (limited to 'launcher/net/HttpMetaCache.h')
-rw-r--r-- | launcher/net/HttpMetaCache.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/launcher/net/HttpMetaCache.h b/launcher/net/HttpMetaCache.h index e944b3d5..df3549e8 100644 --- a/launcher/net/HttpMetaCache.h +++ b/launcher/net/HttpMetaCache.h @@ -64,6 +64,14 @@ class MetaEntry { auto getMD5Sum() -> QString { return md5sum; } void setMD5Sum(QString md5sum) { this->md5sum = md5sum; } + auto getCurrentAge() -> qint64 { return current_age; } + void setCurrentAge(qint64 age) { current_age = age; } + + auto getMaximumAge() -> qint64 { return max_age; } + void setMaximumAge(qint64 age) { max_age = age; } + + bool isExpired(qint64 offset) { return current_age >= max_age - offset; }; + protected: QString baseId; QString basePath; @@ -72,6 +80,8 @@ class MetaEntry { QString etag; qint64 local_changed_timestamp = 0; QString remote_changed_timestamp; // QString for now, RFC 2822 encoded time + qint64 current_age = 0; + qint64 max_age = 0; bool stale = true; }; |