diff options
| author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2016-11-09 16:04:08 -0800 |
|---|---|---|
| committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2016-11-09 16:04:08 -0800 |
| commit | c61ca1dea2001d8b77bf6b1f44da4246c3088e32 (patch) | |
| tree | 1b32af1c171009d9fb4a745ff312d315f1ce4059 /node/Peer.cpp | |
| parent | eea712a1ae80994c32f250537ce14e52071312fb (diff) | |
| download | infinitytier-c61ca1dea2001d8b77bf6b1f44da4246c3088e32.tar.gz infinitytier-c61ca1dea2001d8b77bf6b1f44da4246c3088e32.zip | |
Keep connections up for netconf stuff as well as frames.
Diffstat (limited to 'node/Peer.cpp')
| -rw-r--r-- | node/Peer.cpp | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/node/Peer.cpp b/node/Peer.cpp index 87882dad..94fb5298 100644 --- a/node/Peer.cpp +++ b/node/Peer.cpp @@ -42,8 +42,7 @@ static uint32_t _natKeepaliveBuf = 0; Peer::Peer(const RuntimeEnvironment *renv,const Identity &myIdentity,const Identity &peerIdentity) : _lastReceive(0), - _lastUnicastFrame(0), - _lastMulticastFrame(0), + _lastNontrivialReceive(0), _lastDirectPathPushSent(0), _lastDirectPathPushReceive(0), _lastCredentialRequestSent(0), @@ -128,10 +127,16 @@ void Peer::received( #endif _lastReceive = now; - if ((verb == Packet::VERB_FRAME)||(verb == Packet::VERB_EXT_FRAME)) - _lastUnicastFrame = now; - else if (verb == Packet::VERB_MULTICAST_FRAME) - _lastMulticastFrame = now; + switch (verb) { + case Packet::VERB_FRAME: + case Packet::VERB_EXT_FRAME: + case Packet::VERB_NETWORK_CONFIG_REQUEST: + case Packet::VERB_NETWORK_CONFIG: + case Packet::VERB_MULTICAST_FRAME: + _lastNontrivialReceive = now; + break; + default: break; + } if (trustEstablished) { _lastTrustEstablishedPacketReceived = now; |
