From 8d679b00a7e13fb044d81abc1de0bcb6b16ee2fb Mon Sep 17 00:00:00 2001 From: Jeff Becker Date: Tue, 18 Sep 2018 11:05:56 -0400 Subject: [PATCH] only log errors on sessions made with utp only rebuild paths when introset changes router for outbound context --- llarp/link/utp.cpp | 10 +++++++--- llarp/service/endpoint.cpp | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/llarp/link/utp.cpp b/llarp/link/utp.cpp index 4542b508f..e450fdfb9 100644 --- a/llarp/link/utp.cpp +++ b/llarp/link/utp.cpp @@ -349,11 +349,15 @@ namespace llarp { BaseSession* session = static_cast< BaseSession* >(utp_get_userdata(arg->socket)); - if(arg->error_code == UTP_ETIMEDOUT && session) + if(session) { - session->Router()->OnConnectTimeout(session->GetPubKey()); + if(arg->error_code == UTP_ETIMEDOUT) + { + session->Router()->OnConnectTimeout(session->GetPubKey()); + } + llarp::LogError(utp_error_code_names[arg->error_code], " via ", + session->remoteAddr); } - llarp::LogError(utp_error_code_names[arg->error_code]); return 0; } diff --git a/llarp/service/endpoint.cpp b/llarp/service/endpoint.cpp index 111300ec9..a72443cb5 100644 --- a/llarp/service/endpoint.cpp +++ b/llarp/service/endpoint.cpp @@ -987,8 +987,8 @@ namespace llarp m_Endpoint->EnsureRouterIsKnown(intro.router); if(m_BadIntros.count(intro) == 0 && remoteIntro != intro) { + shifted = intro.router != remoteIntro.router; remoteIntro = intro; - shifted = true; break; } }