avoid redundant sockaddr -> string

This commit is contained in:
Michael Davidsaver
2019-04-15 11:43:10 -07:00
parent a697008f13
commit 3fa1e83b55
2 changed files with 3 additions and 8 deletions

View File

@@ -3620,7 +3620,7 @@ public:
!std::equal(guid.value, guid.value + 12, m_guid.value))
{
EXCEPTION_GUARD3(m_requester, req, req->message("More than one channel with name '" + m_name +
"' detected, connected to: " + inetAddressToString(transport->getRemoteAddress()) + ", ignored: " + inetAddressToString(*serverAddress), warningMessage));
"' detected, connected to: " + transport->getRemoteName() + ", ignored: " + inetAddressToString(*serverAddress), warningMessage));
}
// do not pass (create transports) with we already have one

View File

@@ -716,18 +716,13 @@ void ServerCreateChannelHandler::handleResponse(osiSockAddr* responseFrom,
string channelName = SerializeHelper::deserializeString(payloadBuffer, transport.get());
if (channelName.size() == 0)
{
char host[100];
sockAddrToDottedIP(&transport->getRemoteAddress().sa,host,100);
LOG(logLevelDebug,"Zero length channel name, disconnecting client: %s", host);
LOG(logLevelDebug,"Zero length channel name, disconnecting client: %s", transport->getRemoteName().c_str());
disconnect(transport);
return;
}
else if (channelName.size() > MAX_CHANNEL_NAME_LENGTH)
{
char host[100];
sockAddrToDottedIP(&transport->getRemoteAddress().sa,host,100);
LOG(logLevelDebug,"Unreasonable channel name length, disconnecting client: %s", host);
LOG(logLevelDebug,"Unreasonable channel name length, disconnecting client: %s", transport->getRemoteName().c_str());
disconnect(transport);
return;
}