summaryrefslogtreecommitdiff
path: root/node/SoftwareUpdater.hpp
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2013-12-26 20:57:17 -0800
committerAdam Ierymenko <adam.ierymenko@gmail.com>2013-12-26 20:57:17 -0800
commitc8166b2db15b692d2c3deba2b7b82343ba478873 (patch)
treeb418e8a043185f14d321b77ae20e440a230fde28 /node/SoftwareUpdater.hpp
parent54c2c945e00b4da9931bf16c762860886704c6b3 (diff)
downloadinfinitytier-c8166b2db15b692d2c3deba2b7b82343ba478873.tar.gz
infinitytier-c8166b2db15b692d2c3deba2b7b82343ba478873.zip
Bump version to 0.6.4 for testing, integrate software updater auto-check into PacketDecoder decode path and main loop.
Diffstat (limited to 'node/SoftwareUpdater.hpp')
-rw-r--r--node/SoftwareUpdater.hpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/node/SoftwareUpdater.hpp b/node/SoftwareUpdater.hpp
index 5e47bbea..477bc7e3 100644
--- a/node/SoftwareUpdater.hpp
+++ b/node/SoftwareUpdater.hpp
@@ -76,6 +76,9 @@ public:
/**
* Check for updates now regardless of last check time or version
+ *
+ * This only starts a check if one is not in progress. Otherwise it does
+ * nothing.
*/
inline void checkNow()
{
@@ -88,6 +91,17 @@ public:
}
/**
+ * Check for updates now if it's been longer than ZT_UPDATE_MAX_INTERVAL
+ *
+ * This is called periodically from the main loop.
+ */
+ inline void checkIfMaxIntervalExceeded(uint64_t now)
+ {
+ if ((now - _lastUpdateAttempt) >= ZT_UPDATE_MAX_INTERVAL)
+ checkNow();
+ }
+
+ /**
* Pack three-component version into a 64-bit integer
*
* @param vmaj Major version (0..65535)