summaryrefslogtreecommitdiff
path: root/node/PacketDecoder.cpp
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2014-02-03 10:46:37 -0800
committerAdam Ierymenko <adam.ierymenko@gmail.com>2014-02-03 10:46:37 -0800
commitbf5f09a0c7e388f622c0466f3bec19605c3990b2 (patch)
tree94150d7f491573e35bf10ba9fecfbbe9c63b1292 /node/PacketDecoder.cpp
parenta154d660d936e448bb24fb7c2691ddfd73763b45 (diff)
downloadinfinitytier-bf5f09a0c7e388f622c0466f3bec19605c3990b2.tar.gz
infinitytier-bf5f09a0c7e388f622c0466f3bec19605c3990b2.zip
Yank a code path it turns out we probably don't want.
Diffstat (limited to 'node/PacketDecoder.cpp')
-rw-r--r--node/PacketDecoder.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/node/PacketDecoder.cpp b/node/PacketDecoder.cpp
index 25ec85ce..2a207e0b 100644
--- a/node/PacketDecoder.cpp
+++ b/node/PacketDecoder.cpp
@@ -282,15 +282,18 @@ bool PacketDecoder::_doOK(const RuntimeEnvironment *_r,const SharedPtr<Peer> &pe
switch(inReVerb) {
case Packet::VERB_HELLO: {
- //unsigned int latency = std::min((unsigned int)(Utils::now() - at<uint64_t>(ZT_PROTO_VERB_HELLO__OK__IDX_TIMESTAMP)),(unsigned int)0xffff);
+ unsigned int latency = std::min((unsigned int)(Utils::now() - at<uint64_t>(ZT_PROTO_VERB_HELLO__OK__IDX_TIMESTAMP)),(unsigned int)0xffff);
unsigned int vMajor = (*this)[ZT_PROTO_VERB_HELLO__OK__IDX_MAJOR_VERSION];
unsigned int vMinor = (*this)[ZT_PROTO_VERB_HELLO__OK__IDX_MINOR_VERSION];
unsigned int vRevision = at<uint16_t>(ZT_PROTO_VERB_HELLO__OK__IDX_REVISION);
- TRACE("%s(%s): OK(HELLO), version %u.%u.%u",source().toString().c_str(),_remoteAddress.toString().c_str(),vMajor,vMinor,vRevision);
+ TRACE("%s(%s): OK(HELLO), version %u.%u.%u, latency %u",source().toString().c_str(),_remoteAddress.toString().c_str(),vMajor,vMinor,vRevision,latency);
+ peer->addDirectLatencyMeasurment(latency);
peer->setRemoteVersion(vMajor,vMinor,vRevision);
// If a supernode has a version higher than ours, this causes a software
- // update check to run now.
+ // update check to run now. This might bum-rush download.zerotier.com, but
+ // it's hosted on S3 so hopefully it can take it. This should cause updates
+ // to propagate out very quickly.
if ((_r->updater)&&(_r->topology->isSupernode(peer->address())))
_r->updater->sawRemoteVersion(vMajor,vMinor,vRevision);
} break;