From 778d0cb3fb67c45b501a1767eff7eb98966bb72e Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sun, 16 Apr 2023 12:19:48 +0200 Subject: [PATCH] Socket::ReadUpTo() doesn't support timeouts. --- profiler/src/HttpRequest.cpp | 2 +- public/common/TracySocket.cpp | 2 +- public/common/TracySocket.hpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/profiler/src/HttpRequest.cpp b/profiler/src/HttpRequest.cpp index 37a952a9..c14c3789 100644 --- a/profiler/src/HttpRequest.cpp +++ b/profiler/src/HttpRequest.cpp @@ -80,7 +80,7 @@ void HttpRequest( const char* server, const char* resource, int port, std::funct const auto len = sprintf( request, "GET %s HTTP/1.1\r\nHost: %s\r\nUser-Agent: Tracy Profiler %i.%i.%i (%s)\r\nConnection: close\r\nCache-Control: no-cache, no-store, must-revalidate\r\n\r\n", resource, server, tracy::Version::Major, tracy::Version::Minor, tracy::Version::Patch, GetOsInfo() ); sock.Send( request, len ); char response[4096]; - const auto sz = sock.ReadUpTo( response, 4096, 15 ); + const auto sz = sock.ReadUpTo( response, 4096 ); if( sz < 13 ) return; if( memcmp( response, "HTTP/1.1 200", 12 ) != 0 ) return; auto hdr = response + 13; diff --git a/public/common/TracySocket.cpp b/public/common/TracySocket.cpp index 176bbc7a..080ff44b 100644 --- a/public/common/TracySocket.cpp +++ b/public/common/TracySocket.cpp @@ -353,7 +353,7 @@ int Socket::Recv( void* _buf, int len, int timeout ) } } -int Socket::ReadUpTo( void* _buf, int len, int timeout ) +int Socket::ReadUpTo( void* _buf, int len ) { const auto sock = m_sock.load( std::memory_order_relaxed ); auto buf = (char*)_buf; diff --git a/public/common/TracySocket.hpp b/public/common/TracySocket.hpp index 4b3075e2..f7713aac 100644 --- a/public/common/TracySocket.hpp +++ b/public/common/TracySocket.hpp @@ -29,7 +29,7 @@ public: int Send( const void* buf, int len ); int GetSendBufSize(); - int ReadUpTo( void* buf, int len, int timeout ); + int ReadUpTo( void* buf, int len ); bool Read( void* buf, int len, int timeout ); template