From dd8b03a5c55baf7349ce075c8f4cad1d59cbe988 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko <adam.ierymenko@gmail.com> Date: Wed, 23 Aug 2017 18:28:40 -0700 Subject: [PATCH] Threading issue fix? --- node/Peer.cpp | 7 +++++-- node/Switch.cpp | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/node/Peer.cpp b/node/Peer.cpp index 127f222cf..b3020854b 100644 --- a/node/Peer.cpp +++ b/node/Peer.cpp @@ -424,18 +424,21 @@ void Peer::redirect(void *tPtr,const int64_t localSocket,const InetAddress &remo SharedPtr<Path> op; SharedPtr<Path> np(RR->topology->getPath(localSocket,remoteAddress)); + np->received(now); attemptToContactAt(tPtr,localSocket,remoteAddress,now,true,np->nextOutgoingCounter()); { Mutex::Lock _l(_paths_m); if (remoteAddress.ss_family == AF_INET) { op = _v4Path.p; - _v4Path.p = np; + _v4Path.lr = now; _v4Path.sticky = now; + _v4Path.p = np; } else if (remoteAddress.ss_family == AF_INET6) { op = _v6Path.p; - _v6Path.p = np; + _v6Path.lr = now; _v6Path.sticky = now; + _v6Path.p = np; } } diff --git a/node/Switch.cpp b/node/Switch.cpp index fce126228..952bdef8d 100644 --- a/node/Switch.cpp +++ b/node/Switch.cpp @@ -719,7 +719,7 @@ bool Switch::_trySend(void *tPtr,Packet &packet,bool encrypt) } } } else { - return false; // if we are not in cluster mode, there is no way we can send without knowing the peer directly + return false; } unsigned int chunkSize = std::min(packet.size(),(unsigned int)ZT_UDP_DEFAULT_PAYLOAD_MTU);