From b31cedaba27411114871aa66af227cb6cce1142b Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Fri, 16 Feb 2024 07:02:45 +0100 Subject: [PATCH] Fix wrong log info messages on TCP (#4258) (#4313) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fix wrong log info messages on TCP (#4258) Signed-off-by: Jesus Perez (cherry picked from commit 36f7f57b039d9f762c9d04797c5ee5b34ac0ca1d) # Conflicts: # src/cpp/rtps/transport/TCPTransportInterface.cpp * Refs #20262: Resolve conflicts Signed-off-by: Jesus Perez --------- Signed-off-by: Jesus Perez Co-authored-by: Jesús Pérez <78275223+jepemi@users.noreply.github.com> Co-authored-by: Jesus Perez --- .../rtps/transport/TCPTransportInterface.cpp | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/cpp/rtps/transport/TCPTransportInterface.cpp b/src/cpp/rtps/transport/TCPTransportInterface.cpp index 4a2f4fca18d..611de341248 100644 --- a/src/cpp/rtps/transport/TCPTransportInterface.cpp +++ b/src/cpp/rtps/transport/TCPTransportInterface.cpp @@ -827,6 +827,7 @@ void TCPTransportInterface::perform_listen_operation( if (rtcp_message_manager) { channel = channel_weak.lock(); + endpoint_to_locator(channel->remote_endpoint(), remote_locator); if (channel) { @@ -1312,9 +1313,11 @@ void TCPTransportInterface::SocketAccepted( channel->thread(std::thread(&TCPTransportInterface::perform_listen_operation, this, channel_weak_ptr, rtcp_manager_weak_ptr)); - EPROSIMA_LOG_INFO(RTCP, " Accepted connection (local: " << IPLocator::to_string(locator) - << ", remote: " << channel->remote_endpoint().address() - << ":" << channel->remote_endpoint().port() << ")"); + EPROSIMA_LOG_INFO(RTCP, "Accepted connection (local: " + << channel->local_endpoint().address() << ":" + << channel->local_endpoint().port() << "), remote: " + << channel->remote_endpoint().address() << ":" + << channel->remote_endpoint().port() << ")"); } else { @@ -1358,10 +1361,11 @@ void TCPTransportInterface::SecureSocketAccepted( secure_channel->thread(std::thread(&TCPTransportInterface::perform_listen_operation, this, channel_weak_ptr, rtcp_manager_weak_ptr)); - EPROSIMA_LOG_INFO(RTCP, " Accepted connection (local: " << IPLocator::to_string(locator) - << ", remote: " << socket->lowest_layer().remote_endpoint().address() - << ":" << socket->lowest_layer().remote_endpoint().port() << - ")"); + EPROSIMA_LOG_INFO(RTCP, " Accepted connection (local: " + << socket->lowest_layer().local_endpoint().address() << ":" + << socket->lowest_layer().local_endpoint().port() << "), remote: " + << socket->lowest_layer().remote_endpoint().address() << ":" + << socket->lowest_layer().remote_endpoint().port() << ")"); } else {