From c8166b2db15b692d2c3deba2b7b82343ba478873 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Thu, 26 Dec 2013 20:57:17 -0800 Subject: Bump version to 0.6.4 for testing, integrate software updater auto-check into PacketDecoder decode path and main loop. --- node/SoftwareUpdater.hpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'node/SoftwareUpdater.hpp') 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() { @@ -87,6 +90,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 * -- cgit v1.2.3