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

Require shibboleth match at start of connection.

This commit is contained in:
Bartosz Taudul
2018-09-09 18:26:53 +02:00
parent f55f2858c4
commit 270072b09e
3 changed files with 20 additions and 0 deletions
+15
View File
@@ -913,6 +913,21 @@ void Profiler::Worker()
if( m_sock ) break;
}
{
timeval tv;
tv.tv_sec = 2;
tv.tv_usec = 0;
char shibboleth[HandshakeShibbolethSize];
const auto res = m_sock->ReadRaw( shibboleth, HandshakeShibbolethSize, &tv );
if( !res || memcmp( shibboleth, HandshakeShibboleth, HandshakeShibbolethSize ) != 0 )
{
m_sock->~Socket();
tracy_free( m_sock );
continue;
}
}
#ifdef TRACY_ON_DEMAND
ClearQueues( token );
m_isConnected.store( true, std::memory_order_relaxed );