Merge pull request #426 from loki-project/staging

Staging
This commit is contained in:
Jeff 2019-03-22 08:20:59 -04:00 committed by GitHub
commit 69b785d5eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 13 deletions

View File

@ -132,6 +132,17 @@ namespace llarp
}
else if(msg.questions[0].qtype == dns::qTypeA)
{
if(msg.questions[0].qname == "random.snode"
|| msg.questions[0].qname == "random.snode.")
{
RouterID random;
if(GetRouter()->GetRandomGoodRouter(random))
msg.AddCNAMEReply(random.ToString(), 1);
else
msg.AddNXReply();
reply(msg);
return true;
}
if(msg.questions[0].qname == "localhost.loki."
|| msg.questions[0].qname == "localhost.loki")
{

View File

@ -228,19 +228,9 @@ namespace llarp
bool
Session::IsTimedOut(llarp_time_t now) const
{
if(state == eConnecting)
return false;
if(state == eClose)
return true;
if(now <= lastActive)
return false;
auto dlt = now - lastActive;
if(dlt >= sessionTimeout)
{
LogInfo("session timeout reached for ", remoteAddr, " dlt=", dlt);
return true;
}
return false;
(void)now;
// let utp manage this
return state == eClose;
}
const PubKey&