mirror of
https://github.com/oxen-io/lokinet.git
synced 2024-11-15 12:13:24 +00:00
commit
69b785d5eb
@ -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")
|
||||
{
|
||||
|
@ -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&
|
||||
|
Loading…
Reference in New Issue
Block a user