diff --git a/llarp/handlers/exit.cpp b/llarp/handlers/exit.cpp index 635ab7533..92f1ff686 100644 --- a/llarp/handlers/exit.cpp +++ b/llarp/handlers/exit.cpp @@ -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") { diff --git a/llarp/link/utp.cpp b/llarp/link/utp.cpp index 95b547f86..940e126ee 100644 --- a/llarp/link/utp.cpp +++ b/llarp/link/utp.cpp @@ -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&