From bf5f09a0c7e388f622c0466f3bec19605c3990b2 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Mon, 3 Feb 2014 10:46:37 -0800 Subject: Yank a code path it turns out we probably don't want. --- node/PacketDecoder.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'node/PacketDecoder.cpp') 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 &pe switch(inReVerb) { case Packet::VERB_HELLO: { - //unsigned int latency = std::min((unsigned int)(Utils::now() - at(ZT_PROTO_VERB_HELLO__OK__IDX_TIMESTAMP)),(unsigned int)0xffff); + unsigned int latency = std::min((unsigned int)(Utils::now() - at(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(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; -- cgit v1.2.3