avoid redundant sockaddr -> string

This commit is contained in:
Michael Davidsaver
2019-04-17 09:35:43 -07:00
parent a697008f13
commit 3fa1e83b55
2 changed files with 3 additions and 8 deletions
+2 -7
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;
}