mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-10 10:41:50 +00:00
Issue just one read call when handling server queries.
This commit is contained in:
parent
1bbece649f
commit
b389ccbb38
@ -2315,13 +2315,15 @@ void Profiler::SendCallstackFrame( uint64_t ptr )
|
||||
|
||||
bool Profiler::HandleServerQuery()
|
||||
{
|
||||
ServerQueryPacket payload;
|
||||
if( !m_sock->Read( &payload, sizeof( payload ), 10 ) ) return false;
|
||||
|
||||
uint8_t type;
|
||||
uint64_t ptr;
|
||||
uint32_t extra;
|
||||
|
||||
if( !m_sock->Read( &type, sizeof( type ), 10 ) ) return false;
|
||||
if( !m_sock->Read( &ptr, sizeof( ptr ), 10 ) ) return false;
|
||||
if( !m_sock->Read( &extra, sizeof( extra ), 10 ) ) return false;
|
||||
memcpy( &type, &payload.type, sizeof( payload.type ) );
|
||||
memcpy( &ptr, &payload.ptr, sizeof( payload.ptr ) );
|
||||
memcpy( &extra, &payload.extra, sizeof( payload.extra ) );
|
||||
|
||||
switch( type )
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user