diff --git a/llarp/utp/linklayer.cpp b/llarp/utp/linklayer.cpp index 61ee366aa..e27b0a98f 100644 --- a/llarp/utp/linklayer.cpp +++ b/llarp/utp/linklayer.cpp @@ -330,7 +330,7 @@ namespace llarp const AddressInfo& addr) { return std::make_shared< OutboundSession >( - this, utp_create_socket(_utp_ctx), rc, addr); + this, NewSocket(), rc, addr); } uint64 diff --git a/llarp/utp/session.cpp b/llarp/utp/session.cpp index 4d79414d8..a75cc8de8 100644 --- a/llarp/utp/session.cpp +++ b/llarp/utp/session.cpp @@ -194,10 +194,12 @@ namespace llarp bool Session::TimedOut(llarp_time_t now) const { - if(state == eInitial || state == eLinkEstablished) - return false; + if(state == eConnecting) + return now - lastActive > 5000; if(sendq.size() >= MaxSendQueueSize) { + if(now <= lastSend) + return false; return now - lastSend > 5000; } // let utp manage this