Don't keep connections up longer than the alive timeout (unless they are relays or roots)

This commit is contained in:
Adam Ierymenko 2015-10-13 13:51:54 -07:00
parent 824ed99160
commit 489e1a5b83

View File

@ -206,8 +206,10 @@ public:
} }
} }
if ((!p->doPingAndKeepalive(RR,_now))&&(stableEndpoint)) if ((p->alive(_now))||(upstream)) {
p->attemptToContactAt(RR,InetAddress(),stableEndpoint,_now); if ((!p->doPingAndKeepalive(RR,_now))&&(stableEndpoint))
p->attemptToContactAt(RR,InetAddress(),stableEndpoint,_now);
}
if (upstream) if (upstream)
lastReceiveFromUpstream = std::max(p->lastReceive(),lastReceiveFromUpstream); lastReceiveFromUpstream = std::max(p->lastReceive(),lastReceiveFromUpstream);