summaryrefslogtreecommitdiff
path: root/node
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2019-06-06 10:04:11 -0700
committerAdam Ierymenko <adam.ierymenko@gmail.com>2019-06-06 10:04:11 -0700
commit848f822171a41f78eef7ee0dcab99a6ec53d634a (patch)
tree12db6945a5bfa798c00a98f6a2b915f42bc7f56c /node
parentcacdb445c786f97d5d9af200b17665bb171a42d9 (diff)
parentd4199ddb3ef59b8f754129bfc91f91c18f84759c (diff)
downloadinfinitytier-848f822171a41f78eef7ee0dcab99a6ec53d634a.tar.gz
infinitytier-848f822171a41f78eef7ee0dcab99a6ec53d634a.zip
.
Diffstat (limited to 'node')
-rw-r--r--node/Constants.hpp4
-rw-r--r--node/NetworkConfig.hpp9
-rw-r--r--node/Node.cpp2
-rw-r--r--node/RingBuffer.hpp2
-rw-r--r--node/Switch.cpp6
5 files changed, 18 insertions, 5 deletions
diff --git a/node/Constants.hpp b/node/Constants.hpp
index e8a3e020..4f45f616 100644
--- a/node/Constants.hpp
+++ b/node/Constants.hpp
@@ -482,7 +482,11 @@
/**
* Timeout for overall peer activity (measured from last receive)
*/
+#ifndef ZT_SDK
#define ZT_PEER_ACTIVITY_TIMEOUT 500000
+#else
+#define ZT_PEER_ACTIVITY_TIMEOUT 30000
+#endif
/**
* General rate limit timeout for multiple packet types (HELLO, etc.)
diff --git a/node/NetworkConfig.hpp b/node/NetworkConfig.hpp
index 6367b8ec..be8c03dd 100644
--- a/node/NetworkConfig.hpp
+++ b/node/NetworkConfig.hpp
@@ -274,7 +274,14 @@ public:
/**
* @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)
diff --git a/node/Node.cpp b/node/Node.cpp
index ffa4a700..c9f38ad3 100644
--- a/node/Node.cpp
+++ b/node/Node.cpp
@@ -340,7 +340,7 @@ ZT_ResultCode Node::processBackgroundTasks(void *tptr,int64_t now,volatile int64
// Update online status, post status change as event
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)
postEvent(tptr,_online ? ZT_EVENT_ONLINE : ZT_EVENT_OFFLINE);
} catch ( ... ) {
diff --git a/node/RingBuffer.hpp b/node/RingBuffer.hpp
index e9f17e1c..8b11e9b1 100644
--- a/node/RingBuffer.hpp
+++ b/node/RingBuffer.hpp
@@ -312,6 +312,7 @@ public:
/**
* Print the contents of the buffer
*/
+ /*
inline void dump()
{
size_t iterator = begin;
@@ -325,6 +326,7 @@ public:
}
}
}
+ */
};
} // namespace ZeroTier
diff --git a/node/Switch.cpp b/node/Switch.cpp
index eeab051e..55275dc3 100644
--- a/node/Switch.cpp
+++ b/node/Switch.cpp
@@ -425,7 +425,7 @@ void Switch::onLocalEthernet(void *tPtr,const SharedPtr<Network> &network,const
from.appendTo(outp);
outp.append((uint16_t)etherType);
outp.append(data,len);
- if (!network->config().disableCompression() && !ZT_SDK)
+ if (!network->config().disableCompression())
outp.compress();
aqm_enqueue(tPtr,network,outp,true,qosBucket);
} else {
@@ -433,7 +433,7 @@ void Switch::onLocalEthernet(void *tPtr,const SharedPtr<Network> &network,const
outp.append(network->id());
outp.append((uint16_t)etherType);
outp.append(data,len);
- if (!network->config().disableCompression() && !ZT_SDK)
+ if (!network->config().disableCompression())
outp.compress();
aqm_enqueue(tPtr,network,outp,true,qosBucket);
}
@@ -490,7 +490,7 @@ void Switch::onLocalEthernet(void *tPtr,const SharedPtr<Network> &network,const
from.appendTo(outp);
outp.append((uint16_t)etherType);
outp.append(data,len);
- if (!network->config().disableCompression() && !ZT_SDK)
+ if (!network->config().disableCompression())
outp.compress();
aqm_enqueue(tPtr,network,outp,true,qosBucket);
} else {