From deeea0ee7030d7b99f8fe7ba41b6547accd8cd99 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Mon, 1 Apr 2019 19:37:39 +0200 Subject: [PATCH] Track space left in send buffer. --- server/TracyWorker.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/server/TracyWorker.cpp b/server/TracyWorker.cpp index 87b633f8..59507479 100644 --- a/server/TracyWorker.cpp +++ b/server/TracyWorker.cpp @@ -1814,6 +1814,7 @@ close: void Worker::Query( ServerQuery type, uint64_t data ) { ServerQueryPacket query = { type, data }; + m_serverQuerySpaceLeft--; m_sock.Send( &query, ServerQueryPacketSize ); } @@ -1832,12 +1833,15 @@ bool Worker::DispatchProcess( const QueueItem& ev, char*& ptr ) break; case QueueType::StringData: AddString( ev.stringTransfer.ptr, ptr, sz ); + m_serverQuerySpaceLeft++; break; case QueueType::ThreadName: AddThreadString( ev.stringTransfer.ptr, ptr, sz ); + m_serverQuerySpaceLeft++; break; case QueueType::PlotName: HandlePlotName( ev.stringTransfer.ptr, ptr, sz ); + m_serverQuerySpaceLeft++; break; case QueueType::SourceLocationPayload: AddSourceLocationPayload( ev.stringTransfer.ptr, ptr, sz ); @@ -1847,6 +1851,7 @@ bool Worker::DispatchProcess( const QueueItem& ev, char*& ptr ) break; case QueueType::FrameName: HandleFrameName( ev.stringTransfer.ptr, ptr, sz ); + m_serverQuerySpaceLeft++; break; case QueueType::CallstackAllocPayload: AddCallstackAllocPayload( ev.stringTransfer.ptr, ptr, sz ); @@ -2435,6 +2440,7 @@ bool Worker::Process( const QueueItem& ev ) break; case QueueType::SourceLocation: AddSourceLocation( ev.srcloc ); + m_serverQuerySpaceLeft++; break; case QueueType::ZoneText: ProcessZoneText( ev.zoneText ); @@ -2516,6 +2522,7 @@ bool Worker::Process( const QueueItem& ev ) break; case QueueType::CallstackFrameSize: ProcessCallstackFrameSize( ev.callstackFrameSize ); + m_serverQuerySpaceLeft++; break; case QueueType::CallstackFrame: ProcessCallstackFrame( ev.callstackFrame );