From d32c070a9e20d0eb9296c1fea29ea702e931ae3a Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Tue, 12 Feb 2019 11:07:12 +0100 Subject: [PATCH] Two more places where connection can silently drop. --- server/TracyWorker.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/server/TracyWorker.cpp b/server/TracyWorker.cpp index 33da2e47..df23b67c 100644 --- a/server/TracyWorker.cpp +++ b/server/TracyWorker.cpp @@ -1532,7 +1532,11 @@ void Worker::Exec() { WelcomeMessage welcome; - if( !m_sock.Read( &welcome, sizeof( welcome ), 10, ShouldExit ) ) goto close; + if( !m_sock.Read( &welcome, sizeof( welcome ), 10, ShouldExit ) ) + { + m_handshake.store( HandshakeDropped, std::memory_order_relaxed ); + goto close; + } m_timerMul = welcome.timerMul; const auto initEnd = TscTime( welcome.initEnd ); m_data.framesBase->frames.push_back( FrameEvent{ TscTime( welcome.initBegin ), -1 } ); @@ -1557,7 +1561,11 @@ void Worker::Exec() if( welcome.onDemand != 0 ) { OnDemandPayloadMessage onDemand; - if( !m_sock.Read( &onDemand, sizeof( onDemand ), 10, ShouldExit ) ) goto close; + if( !m_sock.Read( &onDemand, sizeof( onDemand ), 10, ShouldExit ) ) + { + m_handshake.store( HandshakeDropped, std::memory_order_relaxed ); + goto close; + } m_data.frameOffset = onDemand.frames; } }