This commit is contained in:
Brenton Bostick 2023-08-01 11:53:55 -04:00 committed by GitHub
parent 230ae6bd16
commit e36127283c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 5 deletions

View File

@ -299,7 +299,7 @@
/** /**
* Delay between checks of peer pings, etc., and also related housekeeping tasks * Delay between checks of peer pings, etc., and also related housekeeping tasks
*/ */
#define ZT_PING_CHECK_INVERVAL 5000 #define ZT_PING_CHECK_INTERVAL 5000
/** /**
* How often the local.conf file is checked for changes (service, should be moved there) * How often the local.conf file is checked for changes (service, should be moved there)

View File

@ -307,7 +307,7 @@ ZT_ResultCode Node::processBackgroundTasks(void *tptr,int64_t now,volatile int64
Mutex::Lock bl(_backgroundTasksLock); Mutex::Lock bl(_backgroundTasksLock);
// Process background bond tasks // Process background bond tasks
unsigned long bondCheckInterval = ZT_PING_CHECK_INVERVAL; unsigned long bondCheckInterval = ZT_PING_CHECK_INTERVAL;
if (RR->bc->inUse()) { if (RR->bc->inUse()) {
bondCheckInterval = std::max(RR->bc->minReqMonitorInterval(), ZT_CORE_TIMER_TASK_GRANULARITY); bondCheckInterval = std::max(RR->bc->minReqMonitorInterval(), ZT_CORE_TIMER_TASK_GRANULARITY);
if ((now - _lastGratuitousPingCheck) >= ZT_CORE_TIMER_TASK_GRANULARITY) { if ((now - _lastGratuitousPingCheck) >= ZT_CORE_TIMER_TASK_GRANULARITY) {
@ -316,7 +316,7 @@ ZT_ResultCode Node::processBackgroundTasks(void *tptr,int64_t now,volatile int64
} }
} }
unsigned long timeUntilNextPingCheck = _lowBandwidthMode ? (ZT_PING_CHECK_INVERVAL * 5) : ZT_PING_CHECK_INVERVAL; unsigned long timeUntilNextPingCheck = _lowBandwidthMode ? (ZT_PING_CHECK_INTERVAL * 5) : ZT_PING_CHECK_INTERVAL;
const int64_t timeSinceLastPingCheck = now - _lastPingCheck; const int64_t timeSinceLastPingCheck = now - _lastPingCheck;
if (timeSinceLastPingCheck >= timeUntilNextPingCheck) { if (timeSinceLastPingCheck >= timeUntilNextPingCheck) {
try { try {

View File

@ -546,7 +546,7 @@ void LinuxNetLink::_requestIPv4Routes()
la.nl_pid = 0; //getpid(); la.nl_pid = 0; //getpid();
la.nl_groups = RTMGRP_IPV4_ROUTE; la.nl_groups = RTMGRP_IPV4_ROUTE;
if(bind(fd, (struct sockaddr*)&la, sizeof(la))) { if(bind(fd, (struct sockaddr*)&la, sizeof(la))) {
fprintf(stderr, "Error binding RTNETLINK (_requiestIPv4Routes #1): %s\n", strerror(errno)); fprintf(stderr, "Error binding RTNETLINK (_requestIPv4Routes #1): %s\n", strerror(errno));
close(fd); close(fd);
return; return;
} }

View File

@ -3393,7 +3393,7 @@ public:
void *tmpptr = (void *)_tcpFallbackTunnel; void *tmpptr = (void *)_tcpFallbackTunnel;
phyOnTcpWritable(_tcpFallbackTunnel->sock,&tmpptr); phyOnTcpWritable(_tcpFallbackTunnel->sock,&tmpptr);
} }
} else if (_forceTcpRelay || (((now - _lastSendToGlobalV4) < ZT_TCP_FALLBACK_AFTER)&&((now - _lastSendToGlobalV4) > (ZT_PING_CHECK_INVERVAL / 2)))) { } else if (_forceTcpRelay || (((now - _lastSendToGlobalV4) < ZT_TCP_FALLBACK_AFTER)&&((now - _lastSendToGlobalV4) > (ZT_PING_CHECK_INTERVAL / 2)))) {
const InetAddress addr(_fallbackRelayAddress); const InetAddress addr(_fallbackRelayAddress);
TcpConnection *tc = new TcpConnection(); TcpConnection *tc = new TcpConnection();
{ {