Merge pull request #402 from majestrate/staging

prepare for release
pull/409/head
Jeff 5 years ago committed by GitHub
commit c9a21ac30e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -297,7 +297,8 @@ namespace llarp
auto itr = range.first; auto itr = range.first;
while(itr != range.second) while(itr != range.second)
{ {
itr->second->SendKeepAlive(); if(itr->second->ShouldPing())
itr->second->SendKeepAlive();
++itr; ++itr;
} }
} }

@ -61,6 +61,9 @@ namespace llarp
/// renegotiate session when we have a new RC locally /// renegotiate session when we have a new RC locally
std::function< bool(void) > RenegotiateSession; std::function< bool(void) > RenegotiateSession;
/// return true if we should send an explicit keepalive message
std::function< bool(void) > ShouldPing;
}; };
} // namespace llarp } // namespace llarp

@ -591,6 +591,11 @@ namespace llarp
SendQueueBacklog = [&]() -> size_t { return sendq.size(); }; SendQueueBacklog = [&]() -> size_t { return sendq.size(); };
ShouldPing = [&]() -> bool {
auto dlt = parent->Now() - lastActive;
return dlt >= 10000;
};
SendKeepAlive = [&]() -> bool { SendKeepAlive = [&]() -> bool {
if(state == eSessionReady) if(state == eSessionReady)
{ {

@ -1 +1 @@
subscribe to pewdiepie something something onion routing

Loading…
Cancel
Save