mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-01 23:10:52 +00:00
Send timestamp with new circuit test response.
This commit is contained in:
parent
87b53d67c5
commit
a109d341ef
@ -782,8 +782,8 @@ unsigned int EmbeddedNetworkController::handleControlPlaneHttpPOST(
|
|||||||
return 500;
|
return 500;
|
||||||
}
|
}
|
||||||
|
|
||||||
char json[1024];
|
char json[512];
|
||||||
Utils::snprintf(json,sizeof(json),"{\"testId\":\"%.16llx\"}",test->testId);
|
Utils::snprintf(json,sizeof(json),"{\"testId\":\"%.16llx\",\"timestamp\":%llu}",test->testId,test->timestamp);
|
||||||
responseBody = json;
|
responseBody = json;
|
||||||
responseContentType = "application/json";
|
responseContentType = "application/json";
|
||||||
|
|
||||||
@ -1808,7 +1808,7 @@ void EmbeddedNetworkController::_pushMemberUpdate(uint64_t now,uint64_t nwid,con
|
|||||||
bool online;
|
bool online;
|
||||||
{
|
{
|
||||||
Mutex::Lock _l(_lastRequestTime_m);
|
Mutex::Lock _l(_lastRequestTime_m);
|
||||||
std::map<std::pair<uint64_t,uint64_t>,uint64_t>::iterator lrt(_lastRequestTime.find(std::pair<uint64_t,uint64_t>(id.address().toInt(),nwid)));
|
std::map< std::pair<uint64_t,uint64_t>,uint64_t >::iterator lrt(_lastRequestTime.find(std::pair<uint64_t,uint64_t>(id.address().toInt(),nwid)));
|
||||||
online = ( (lrt != _lastRequestTime.end()) && ((now - lrt->second) < ZT_NETWORK_AUTOCONF_DELAY) );
|
online = ( (lrt != _lastRequestTime.end()) && ((now - lrt->second) < ZT_NETWORK_AUTOCONF_DELAY) );
|
||||||
}
|
}
|
||||||
if (online) {
|
if (online) {
|
||||||
|
@ -204,7 +204,7 @@ private:
|
|||||||
std::list< ZT_CircuitTest > _tests;
|
std::list< ZT_CircuitTest > _tests;
|
||||||
Mutex _tests_m;
|
Mutex _tests_m;
|
||||||
|
|
||||||
std::map< std::pair<uint64_t,uint64_t>,uint64_t > _lastRequestTime;
|
std::map< std::pair<uint64_t,uint64_t>,uint64_t > _lastRequestTime; // last request time by <address,networkId>
|
||||||
Mutex _lastRequestTime_m;
|
Mutex _lastRequestTime_m;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user