mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-06 20:43:44 +02:00
Fixed ZT_SDK build issue. Moved ZT_SDK preprocessor directives to more permanent homes
This commit is contained in:
parent
4743ad0b16
commit
90d324ae96
4 changed files with 16 additions and 5 deletions
|
@ -482,7 +482,11 @@
|
||||||
/**
|
/**
|
||||||
* Timeout for overall peer activity (measured from last receive)
|
* Timeout for overall peer activity (measured from last receive)
|
||||||
*/
|
*/
|
||||||
|
#ifndef ZT_SDK
|
||||||
#define ZT_PEER_ACTIVITY_TIMEOUT 500000
|
#define ZT_PEER_ACTIVITY_TIMEOUT 500000
|
||||||
|
#else
|
||||||
|
#define ZT_PEER_ACTIVITY_TIMEOUT 30000
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* General rate limit timeout for multiple packet types (HELLO, etc.)
|
* General rate limit timeout for multiple packet types (HELLO, etc.)
|
||||||
|
|
|
@ -274,7 +274,14 @@ public:
|
||||||
/**
|
/**
|
||||||
* @return True if frames should not be compressed
|
* @return True if frames should not be compressed
|
||||||
*/
|
*/
|
||||||
inline bool disableCompression() const { return ((this->flags & ZT_NETWORKCONFIG_FLAG_DISABLE_COMPRESSION) != 0); }
|
inline bool disableCompression() const
|
||||||
|
{
|
||||||
|
#ifndef ZT_SDK
|
||||||
|
return ((this->flags & ZT_NETWORKCONFIG_FLAG_DISABLE_COMPRESSION) != 0);
|
||||||
|
#else
|
||||||
|
return false; // Compression is disabled for SDK builds since it doesn't play nice with lwIP
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return Network type is public (no access control)
|
* @return Network type is public (no access control)
|
||||||
|
|
|
@ -340,7 +340,7 @@ ZT_ResultCode Node::processBackgroundTasks(void *tptr,int64_t now,volatile int64
|
||||||
|
|
||||||
// Update online status, post status change as event
|
// Update online status, post status change as event
|
||||||
const bool oldOnline = _online;
|
const bool oldOnline = _online;
|
||||||
_online = (((now - lastReceivedFromUpstream) < (ZT_PEER_ACTIVITY_TIMEOUT / (ZT_SDK ? 16 : 1)))||(RR->topology->amUpstream()));
|
_online = (((now - lastReceivedFromUpstream) < ZT_PEER_ACTIVITY_TIMEOUT)||(RR->topology->amUpstream()));
|
||||||
if (oldOnline != _online)
|
if (oldOnline != _online)
|
||||||
postEvent(tptr,_online ? ZT_EVENT_ONLINE : ZT_EVENT_OFFLINE);
|
postEvent(tptr,_online ? ZT_EVENT_ONLINE : ZT_EVENT_OFFLINE);
|
||||||
} catch ( ... ) {
|
} catch ( ... ) {
|
||||||
|
|
|
@ -425,7 +425,7 @@ void Switch::onLocalEthernet(void *tPtr,const SharedPtr<Network> &network,const
|
||||||
from.appendTo(outp);
|
from.appendTo(outp);
|
||||||
outp.append((uint16_t)etherType);
|
outp.append((uint16_t)etherType);
|
||||||
outp.append(data,len);
|
outp.append(data,len);
|
||||||
if (!network->config().disableCompression() && !ZT_SDK)
|
if (!network->config().disableCompression())
|
||||||
outp.compress();
|
outp.compress();
|
||||||
aqm_enqueue(tPtr,network,outp,true,qosBucket);
|
aqm_enqueue(tPtr,network,outp,true,qosBucket);
|
||||||
} else {
|
} else {
|
||||||
|
@ -433,7 +433,7 @@ void Switch::onLocalEthernet(void *tPtr,const SharedPtr<Network> &network,const
|
||||||
outp.append(network->id());
|
outp.append(network->id());
|
||||||
outp.append((uint16_t)etherType);
|
outp.append((uint16_t)etherType);
|
||||||
outp.append(data,len);
|
outp.append(data,len);
|
||||||
if (!network->config().disableCompression() && !ZT_SDK)
|
if (!network->config().disableCompression())
|
||||||
outp.compress();
|
outp.compress();
|
||||||
aqm_enqueue(tPtr,network,outp,true,qosBucket);
|
aqm_enqueue(tPtr,network,outp,true,qosBucket);
|
||||||
}
|
}
|
||||||
|
@ -490,7 +490,7 @@ void Switch::onLocalEthernet(void *tPtr,const SharedPtr<Network> &network,const
|
||||||
from.appendTo(outp);
|
from.appendTo(outp);
|
||||||
outp.append((uint16_t)etherType);
|
outp.append((uint16_t)etherType);
|
||||||
outp.append(data,len);
|
outp.append(data,len);
|
||||||
if (!network->config().disableCompression() && !ZT_SDK)
|
if (!network->config().disableCompression())
|
||||||
outp.compress();
|
outp.compress();
|
||||||
aqm_enqueue(tPtr,network,outp,true,qosBucket);
|
aqm_enqueue(tPtr,network,outp,true,qosBucket);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Reference in a new issue