From 8c20f4e1fd3a6e7638511af1059d654fae440234 Mon Sep 17 00:00:00 2001 From: Pavel Pimenov Date: Fri, 21 Oct 2016 03:49:59 +0300 Subject: [PATCH] utp_match: Reduced call boost::asio::ip::address address() (#1235) check connection ID before source address in uTP connection lookup --- src/utp_stream.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utp_stream.cpp b/src/utp_stream.cpp index 8f7b94087..37977d017 100644 --- a/src/utp_stream.cpp +++ b/src/utp_stream.cpp @@ -719,9 +719,9 @@ bool utp_incoming_packet(utp_socket_impl* s bool utp_match(utp_socket_impl* s, udp::endpoint const& ep, std::uint16_t id) { - return s->m_remote_address == ep.address() + return s->m_recv_id == id && s->m_port == ep.port() - && s->m_recv_id == id; + && s->m_remote_address == ep.address(); } udp::endpoint utp_remote_endpoint(utp_socket_impl* s)