From ec57c72e083912d09a9be5a3ddfb6af75478ac10 Mon Sep 17 00:00:00 2001 From: Jeff Becker Date: Thu, 27 Dec 2018 13:27:43 -0500 Subject: [PATCH] fix testnet --- llarp/link/utp.cpp | 2 +- llarp/pathbuilder.cpp | 3 ++- llarp/router.cpp | 2 +- llarp/service/endpoint.cpp | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/llarp/link/utp.cpp b/llarp/link/utp.cpp index 26c279c4d..6a45ad1fa 100644 --- a/llarp/link/utp.cpp +++ b/llarp/link/utp.cpp @@ -1088,7 +1088,7 @@ namespace llarp llarp::LogDebug("got message ", msgid, " from ", remoteAddr); result = parent->HandleMessage(this, buf); // get rid of message buffer - itr = m_RecvMsgs.erase(itr); + m_RecvMsgs.erase(itr); } return result; } diff --git a/llarp/pathbuilder.cpp b/llarp/pathbuilder.cpp index 8ee359598..f10448ba3 100644 --- a/llarp/pathbuilder.cpp +++ b/llarp/pathbuilder.cpp @@ -303,7 +303,8 @@ namespace llarp Builder::HandlePathBuildTimeout(Path* p) { // linear backoff - buildIntervalLimit += 1000; + static constexpr llarp_time_t MaxBuildInterval = 10 * 1000; + buildIntervalLimit = std::max(1000 + buildIntervalLimit, MaxBuildInterval); PathSet::HandlePathBuildTimeout(p); } diff --git a/llarp/router.cpp b/llarp/router.cpp index c3e6a704d..fee882a72 100644 --- a/llarp/router.cpp +++ b/llarp/router.cpp @@ -849,7 +849,7 @@ namespace llarp llarp::ILinkLayer * Router::GetLinkWithSessionByPubkey(const llarp::RouterID &pubkey) { - if(outboundLink->HasSessionTo(pubkey)) + if(outboundLink && outboundLink->HasSessionTo(pubkey)) return outboundLink.get(); for(const auto &link : inboundLinks) { diff --git a/llarp/service/endpoint.cpp b/llarp/service/endpoint.cpp index 83a1a904b..09bddfdcc 100644 --- a/llarp/service/endpoint.cpp +++ b/llarp/service/endpoint.cpp @@ -221,7 +221,7 @@ namespace llarp continue; byte_t tmp[1024] = {0}; auto buf = StackBuffer< decltype(tmp) >(tmp); - if(!SendToServiceOrQueue(introset.A.Addr().data(), buf, + if(!SendToServiceOrQueue(introset.A.Addr().data().data(), buf, eProtocolText)) { llarp::LogWarn(Name(), " failed to send/queue data to ",