Comment out and disable old auto-update code.

This commit is contained in:
Adam Ierymenko 2017-01-10 12:20:29 -08:00
parent ef7faa7291
commit 6fb49f68fc
3 changed files with 5 additions and 44 deletions

View File

@ -24,7 +24,7 @@ ZT_USE_MINIUPNPC?=1
# For internal use only -- signs everything with ZeroTier's developer cert
ifeq ($(ZT_OFFICIAL_RELEASE),1)
DEFS+=-DZT_OFFICIAL_RELEASE -DZT_AUTO_UPDATE
DEFS+=-DZT_OFFICIAL_RELEASE
ZT_USE_MINIUPNPC=1
CODESIGN=codesign
PRODUCTSIGN=productsign
@ -36,10 +36,6 @@ ifeq ($(ZT_ENABLE_CLUSTER),1)
DEFS+=-DZT_ENABLE_CLUSTER
endif
ifeq ($(ZT_AUTO_UPDATE),1)
DEFS+=-DZT_AUTO_UPDATE
endif
ifeq ($(ZT_USE_MINIUPNPC),1)
DEFS+=-DMACOSX -DZT_USE_MINIUPNPC -DMINIUPNP_STATICLIB -D_DARWIN_C_SOURCE -DMINIUPNPC_SET_SOCKET_TIMEOUT -DMINIUPNPC_GET_SRC_ADDR -D_BSD_SOURCE -D_DEFAULT_SOURCE -DOS_STRING=\"Darwin/15.0.0\" -DMINIUPNPC_VERSION_STRING=\"2.0\" -DUPNP_VERSION_STRING=\"UPnP/1.1\" -DENABLE_STRNATPMPERR
OBJS+=ext/libnatpmp/natpmp.o ext/libnatpmp/getgateway.o ext/miniupnpc/connecthostport.o ext/miniupnpc/igd_desc_parse.o ext/miniupnpc/minisoap.o ext/miniupnpc/minissdpc.o ext/miniupnpc/miniupnpc.o ext/miniupnpc/miniwget.o ext/miniupnpc/minixml.o ext/miniupnpc/portlistingparse.o ext/miniupnpc/receivedata.o ext/miniupnpc/upnpcommands.o ext/miniupnpc/upnpdev.o ext/miniupnpc/upnperrors.o ext/miniupnpc/upnpreplyparse.o osdep/PortMapper.o

View File

@ -194,6 +194,8 @@ static std::string _jS(const json &jv,const char *dfl)
return std::string((dfl) ? dfl : "");
}
#if 0
#ifdef ZT_AUTO_UPDATE
#define ZT_AUTO_UPDATE_MAX_HTTP_RESPONSE_SIZE (1024 * 1024 * 64)
#define ZT_AUTO_UPDATE_CHECK_PERIOD 21600000
@ -403,6 +405,8 @@ public:
static BackgroundSoftwareUpdateChecker backgroundSoftwareUpdateChecker;
#endif // ZT_AUTO_UPDATE
#endif
static std::string _trimString(const std::string &s)
{
unsigned long end = (unsigned long)s.length();
@ -947,9 +951,6 @@ public:
uint64_t lastTcpFallbackResolve = 0;
uint64_t lastBindRefresh = 0;
uint64_t lastLocalInterfaceAddressCheck = (OSUtils::now() - ZT_LOCAL_INTERFACE_CHECK_INTERVAL) + 15000; // do this in 15s to give portmapper time to configure and other things time to settle
#ifdef ZT_AUTO_UPDATE
uint64_t lastSoftwareUpdateCheck = 0;
#endif // ZT_AUTO_UPDATE
for(;;) {
_run_m.lock();
if (!_run) {
@ -994,13 +995,6 @@ public:
dl = _nextBackgroundTaskDeadline;
}
#ifdef ZT_AUTO_UPDATE
if ((now - lastSoftwareUpdateCheck) >= ZT_AUTO_UPDATE_CHECK_PERIOD) {
lastSoftwareUpdateCheck = now;
Thread::start(&backgroundSoftwareUpdateChecker);
}
#endif // ZT_AUTO_UPDATE
if ((now - lastTcpFallbackResolve) >= ZT_TCP_FALLBACK_RERESOLVE_DELAY) {
lastTcpFallbackResolve = now;
_tcpFallbackResolver.resolveNow();
@ -2245,30 +2239,6 @@ std::string OneService::platformDefaultHomePath()
return OSUtils::platformDefaultHomePath();
}
std::string OneService::autoUpdateUrl()
{
#ifdef ZT_AUTO_UPDATE
/*
#if defined(__LINUX__) && ( defined(__i386__) || defined(__x86_64) || defined(__x86_64__) || defined(__amd64) || defined(__i386) )
if (sizeof(void *) == 8)
return "http://download.zerotier.com/ZeroTierOneInstaller-linux-x64-LATEST.nfo";
else return "http://download.zerotier.com/ZeroTierOneInstaller-linux-x86-LATEST.nfo";
#endif
*/
#if defined(__APPLE__) && ( defined(__i386__) || defined(__x86_64) || defined(__x86_64__) || defined(__amd64) || defined(__i386) )
return "http://download.zerotier.com/update/mac_intel/";
#endif
#ifdef __WINDOWS__
return "http://download.zerotier.com/update/win_intel/";
#endif
#endif // ZT_AUTO_UPDATE
return std::string();
}
OneService *OneService::newInstance(const char *hp,unsigned int port) { return new OneServiceImpl(hp,port); }
OneService::~OneService() {}

View File

@ -81,11 +81,6 @@ public:
*/
static std::string platformDefaultHomePath();
/**
* @return Auto-update URL or empty string if auto-updates unsupported or not enabled
*/
static std::string autoUpdateUrl();
/**
* Create a new instance of the service
*