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()
|
bool Profiler::HandleServerQuery()
|
||||||
{
|
{
|
||||||
|
ServerQueryPacket payload;
|
||||||
|
if( !m_sock->Read( &payload, sizeof( payload ), 10 ) ) return false;
|
||||||
|
|
||||||
uint8_t type;
|
uint8_t type;
|
||||||
uint64_t ptr;
|
uint64_t ptr;
|
||||||
uint32_t extra;
|
uint32_t extra;
|
||||||
|
memcpy( &type, &payload.type, sizeof( payload.type ) );
|
||||||
if( !m_sock->Read( &type, sizeof( type ), 10 ) ) return false;
|
memcpy( &ptr, &payload.ptr, sizeof( payload.ptr ) );
|
||||||
if( !m_sock->Read( &ptr, sizeof( ptr ), 10 ) ) return false;
|
memcpy( &extra, &payload.extra, sizeof( payload.extra ) );
|
||||||
if( !m_sock->Read( &extra, sizeof( extra ), 10 ) ) return false;
|
|
||||||
|
|
||||||
switch( type )
|
switch( type )
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user