mirror of
https://github.com/lubosz/overte.git
synced 2025-08-13 12:11:03 +02:00
Merge pull request #15653 from roxanneskelly/domaincheckin
BUGZ-322 - high_resolution_clock behaves differently on windows and linux
This commit is contained in:
commit
0084ceae6d
2 changed files with 8 additions and 9 deletions
|
@ -1174,8 +1174,8 @@ void DomainServer::sendDomainListToNode(const SharedNodePointer& node, quint64 r
|
||||||
extendedHeaderStream << node->getPermissions();
|
extendedHeaderStream << node->getPermissions();
|
||||||
extendedHeaderStream << limitedNodeList->getAuthenticatePackets();
|
extendedHeaderStream << limitedNodeList->getAuthenticatePackets();
|
||||||
extendedHeaderStream << nodeData->getLastDomainCheckinTimestamp();
|
extendedHeaderStream << nodeData->getLastDomainCheckinTimestamp();
|
||||||
extendedHeaderStream << requestPacketReceiveTime;
|
extendedHeaderStream << quint64(duration_cast<microseconds>(system_clock::now().time_since_epoch()).count());
|
||||||
extendedHeaderStream << quint64(duration_cast<microseconds>(p_high_resolution_clock::now().time_since_epoch()).count());
|
extendedHeaderStream << quint64(duration_cast<microseconds>(p_high_resolution_clock::now().time_since_epoch()).count()) - requestPacketReceiveTime;
|
||||||
auto domainListPackets = NLPacketList::create(PacketType::DomainList, extendedHeader);
|
auto domainListPackets = NLPacketList::create(PacketType::DomainList, extendedHeader);
|
||||||
|
|
||||||
// always send the node their own UUID back
|
// always send the node their own UUID back
|
||||||
|
|
|
@ -416,7 +416,7 @@ void NodeList::sendDomainServerCheckIn() {
|
||||||
packetStream << FingerprintUtils::getMachineFingerprint();
|
packetStream << FingerprintUtils::getMachineFingerprint();
|
||||||
}
|
}
|
||||||
|
|
||||||
packetStream << quint64(duration_cast<microseconds>(p_high_resolution_clock::now().time_since_epoch()).count());
|
packetStream << quint64(duration_cast<microseconds>(system_clock::now().time_since_epoch()).count());
|
||||||
|
|
||||||
// pack our data to send to the domain-server including
|
// pack our data to send to the domain-server including
|
||||||
// the hostname information (so the domain-server can see which place name we came in on)
|
// the hostname information (so the domain-server can see which place name we came in on)
|
||||||
|
@ -649,21 +649,20 @@ void NodeList::processDomainServerList(QSharedPointer<ReceivedMessage> message)
|
||||||
bool isAuthenticated;
|
bool isAuthenticated;
|
||||||
packetStream >> isAuthenticated;
|
packetStream >> isAuthenticated;
|
||||||
|
|
||||||
qint64 now = qint64(duration_cast<microseconds>(p_high_resolution_clock::now().time_since_epoch()).count());
|
qint64 now = qint64(duration_cast<microseconds>(system_clock::now().time_since_epoch()).count());
|
||||||
|
|
||||||
quint64 connectRequestTimestamp;
|
quint64 connectRequestTimestamp;
|
||||||
packetStream >> connectRequestTimestamp;
|
packetStream >> connectRequestTimestamp;
|
||||||
|
|
||||||
quint64 domainServerRequestReceiveTime;
|
|
||||||
packetStream >> domainServerRequestReceiveTime;
|
|
||||||
|
|
||||||
quint64 domainServerPingSendTime;
|
quint64 domainServerPingSendTime;
|
||||||
packetStream >> domainServerPingSendTime;
|
packetStream >> domainServerPingSendTime;
|
||||||
|
|
||||||
|
quint64 domainServerCheckinProcessingTime;
|
||||||
|
packetStream >> domainServerCheckinProcessingTime;
|
||||||
|
|
||||||
qint64 pingLagTime = (now - qint64(connectRequestTimestamp)) / qint64(USECS_PER_MSEC);
|
qint64 pingLagTime = (now - qint64(connectRequestTimestamp)) / qint64(USECS_PER_MSEC);
|
||||||
|
|
||||||
qint64 domainServerRequestLag = (qint64(domainServerRequestReceiveTime) - qint64(connectRequestTimestamp)) / qint64(USECS_PER_MSEC);
|
qint64 domainServerRequestLag = (qint64(domainServerPingSendTime - domainServerCheckinProcessingTime) - qint64(connectRequestTimestamp)) / qint64(USECS_PER_MSEC);;
|
||||||
quint64 domainServerCheckinProcessingTime = domainServerPingSendTime - domainServerRequestReceiveTime;
|
|
||||||
qint64 domainServerResponseLag = (now - qint64(domainServerPingSendTime)) / qint64(USECS_PER_MSEC);
|
qint64 domainServerResponseLag = (now - qint64(domainServerPingSendTime)) / qint64(USECS_PER_MSEC);
|
||||||
|
|
||||||
if (_domainHandler.getSockAddr().isNull()) {
|
if (_domainHandler.getSockAddr().isNull()) {
|
||||||
|
|
Loading…
Reference in a new issue