summaryrefslogtreecommitdiff
path: root/node
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2015-10-13 13:51:54 -0700
committerAdam Ierymenko <adam.ierymenko@gmail.com>2015-10-13 13:51:54 -0700
commit489e1a5b8339403288a4a88b91ae01cb0092ddca (patch)
tree2c2de7198f61e8bb4c77d6c88ace661baea6bccf /node
parent824ed99160607ddf42a520f46f65c17e4abe9bd0 (diff)
downloadinfinitytier-489e1a5b8339403288a4a88b91ae01cb0092ddca.tar.gz
infinitytier-489e1a5b8339403288a4a88b91ae01cb0092ddca.zip
Don't keep connections up longer than the alive timeout (unless they are relays or roots)
Diffstat (limited to 'node')
-rw-r--r--node/Node.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/node/Node.cpp b/node/Node.cpp
index be37b7c7..d72bc73f 100644
--- a/node/Node.cpp
+++ b/node/Node.cpp
@@ -206,8 +206,10 @@ public:
}
}
- if ((!p->doPingAndKeepalive(RR,_now))&&(stableEndpoint))
- p->attemptToContactAt(RR,InetAddress(),stableEndpoint,_now);
+ if ((p->alive(_now))||(upstream)) {
+ if ((!p->doPingAndKeepalive(RR,_now))&&(stableEndpoint))
+ p->attemptToContactAt(RR,InetAddress(),stableEndpoint,_now);
+ }
if (upstream)
lastReceiveFromUpstream = std::max(p->lastReceive(),lastReceiveFromUpstream);