face: Avoid calls to socket::local_endpoint()
Change-Id: I0cb9152efb95faa105a0d0e08ebfb263581d4d43
Refs: #1741
diff --git a/daemon/face/stream-face.hpp b/daemon/face/stream-face.hpp
index 12cc2bc..f9b7cd9 100644
--- a/daemon/face/stream-face.hpp
+++ b/daemon/face/stream-face.hpp
@@ -208,7 +208,7 @@
return;
NFD_LOG_INFO("[id:" << this->getId()
- << ",endpoint:" << m_socket->local_endpoint()
+ << ",uri:" << this->getRemoteUri()
<< "] Close connection");
closeSocket();
@@ -231,13 +231,13 @@
if (error == boost::asio::error::eof)
{
NFD_LOG_INFO("[id:" << this->getId()
- << ",endpoint:" << m_socket->local_endpoint()
+ << ",uri:" << this->getRemoteUri()
<< "] Connection closed");
}
else
{
NFD_LOG_WARN("[id:" << this->getId()
- << ",endpoint:" << m_socket->local_endpoint()
+ << ",uri:" << this->getRemoteUri()
<< "] Send or receive operation failed, closing socket: "
<< error.category().message(error.value()));
}
@@ -265,7 +265,7 @@
return processErrorCode(error);
NFD_LOG_TRACE("[id:" << this->getId()
- << ",endpoint:" << m_socket->local_endpoint()
+ << ",uri:" << this->getRemoteUri()
<< "] Successfully sent: " << wire.size() << " bytes");
}
@@ -278,7 +278,7 @@
return processErrorCode(error);
NFD_LOG_TRACE("[id:" << this->getId()
- << ",endpoint:" << m_socket->local_endpoint()
+ << ",uri:" << this->getRemoteUri()
<< "] Successfully sent: " << (header.size()+payload.size()) << " bytes");
}
@@ -291,7 +291,7 @@
return processErrorCode(error);
NFD_LOG_TRACE("[id:" << this->getId()
- << ",endpoint:" << m_socket->local_endpoint()
+ << ",uri:" << this->getRemoteUri()
<< "] Received: " << bytes_recvd << " bytes");
m_inputBufferSize += bytes_recvd;
@@ -314,7 +314,7 @@
if (!this->decodeAndDispatchInput(element))
{
NFD_LOG_WARN("[id:" << this->getId()
- << ",endpoint:" << m_socket->local_endpoint()
+ << ",uri:" << this->getRemoteUri()
<< "] Received unrecognized block of type ["
<< element.type() << "]");
// ignore unknown packet and proceed
@@ -323,7 +323,7 @@
if (!isOk && m_inputBufferSize == MAX_NDN_PACKET_SIZE && offset == 0)
{
NFD_LOG_WARN("[id:" << this->getId()
- << ",endpoint:" << m_socket->local_endpoint()
+ << ",uri:" << this->getRemoteUri()
<< "] Failed to parse incoming packet or it is too large to process, "
<< "closing down the face");