mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-25 23:44:35 +00:00
format
This commit is contained in:
parent
584a1c8b56
commit
b9323c1029
@ -456,7 +456,7 @@ static void UpdateBroadcastClients()
|
||||
auto parsedMessageOpt = tracy::ParseBroadcastMessage(msg, len);
|
||||
if (parsedMessageOpt.has_value())
|
||||
{
|
||||
auto parsedMessage = parsedMessageOpt.value();
|
||||
auto parsedMessage = parsedMessageOpt.value();
|
||||
auto address = addr.GetText();
|
||||
const auto clientId = tracy::ClientUniqueID(addr, parsedMessage.listenPort);
|
||||
const auto ipNumerical = addr.GetNumber();
|
||||
@ -478,16 +478,24 @@ static void UpdateBroadcastClients()
|
||||
} );
|
||||
}
|
||||
resolvLock.unlock();
|
||||
clients.emplace( clientId, ClientData { time, parsedMessage.protocolVersion, parsedMessage.activeTime, parsedMessage.listenPort, parsedMessage.pid, parsedMessage.programName, std::move( ip ) } );
|
||||
clients.emplace(clientId,
|
||||
ClientData{time,
|
||||
parsedMessage.protocolVersion,
|
||||
parsedMessage.activeTime,
|
||||
parsedMessage.listenPort,
|
||||
parsedMessage.pid,
|
||||
parsedMessage.programName,
|
||||
std::move(ip)});
|
||||
}
|
||||
else
|
||||
{
|
||||
it->second.time = time;
|
||||
it->second.activeTime = parsedMessage.activeTime;
|
||||
it->second.port = parsedMessage.listenPort;
|
||||
it->second.pid = parsedMessage.pid;
|
||||
it->second.activeTime = parsedMessage.activeTime;
|
||||
it->second.port = parsedMessage.listenPort;
|
||||
it->second.pid = parsedMessage.pid;
|
||||
it->second.protocolVersion = parsedMessage.protocolVersion;
|
||||
if( strcmp( it->second.procName.c_str(), parsedMessage.programName ) != 0 ) it->second.procName = parsedMessage.programName;
|
||||
if (strcmp(it->second.procName.c_str(), parsedMessage.programName) != 0)
|
||||
it->second.procName = parsedMessage.programName;
|
||||
}
|
||||
}
|
||||
else if( it != clients.end() )
|
||||
|
@ -651,7 +651,7 @@ void IpAddress::Set( const struct sockaddr& addr )
|
||||
#else
|
||||
auto ai = (const struct sockaddr_in*)&addr;
|
||||
#endif
|
||||
inet_ntop( AF_INET, &ai->sin_addr, m_text, TEXT_SIZE );
|
||||
inet_ntop(AF_INET, &ai->sin_addr, m_text, TEXT_SIZE);
|
||||
m_number = ai->sin_addr.s_addr;
|
||||
}
|
||||
|
||||
|
@ -104,4 +104,4 @@ uint64_t ClientUniqueID(tracy::IpAddress const& addr, uint16_t port)
|
||||
{
|
||||
return uint64_t(addr.GetNumber()) | (uint64_t(port) << 32);
|
||||
}
|
||||
}
|
||||
} // namespace tracy
|
||||
|
@ -12,6 +12,6 @@ namespace tracy
|
||||
std::optional<tracy::BroadcastMessage> ParseBroadcastMessage(const char* msg, size_t msgLen);
|
||||
// internal unique ID for a client
|
||||
uint64_t ClientUniqueID(tracy::IpAddress const& addr, uint16_t port);
|
||||
}
|
||||
} // namespace tracy
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user