1
0
mirror of https://github.com/wolfpld/tracy.git synced 2025-03-20 07:40:02 +08:00

Handle dropped connection during handshake.

This commit is contained in:
Bartosz Taudul
2019-02-12 01:41:09 +01:00
parent 8717fe5730
commit 7f11260bf0
3 changed files with 33 additions and 6 deletions
+5 -1
View File
@@ -1503,7 +1503,11 @@ void Worker::Exec()
uint32_t protocolVersion = ProtocolVersion;
m_sock.Send( &protocolVersion, sizeof( protocolVersion ) );
HandshakeStatus handshake;
if( !m_sock.Read( &handshake, sizeof( handshake ), 10, ShouldExit ) ) goto close;
if( !m_sock.Read( &handshake, sizeof( handshake ), 10, ShouldExit ) )
{
m_handshake.store( HandshakeDropped, std::memory_order_relaxed );
goto close;
}
m_handshake.store( handshake, std::memory_order_relaxed );
switch( handshake )
{