Include git reference in user agent.

This commit is contained in:
Bartosz Taudul 2024-09-09 20:27:12 +02:00
parent 323778e96f
commit 5795bc5766
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3

View File

@ -5,6 +5,7 @@
#include "../public/common/TracySocket.hpp" #include "../public/common/TracySocket.hpp"
#include "../public/common/TracyVersion.hpp" #include "../public/common/TracyVersion.hpp"
#include "GitRef.hpp"
#include "HttpRequest.hpp" #include "HttpRequest.hpp"
#if defined _WIN32 #if defined _WIN32
@ -88,7 +89,7 @@ void HttpRequest( const char* server, const char* resource, int port, const std:
tracy::Socket sock; tracy::Socket sock;
if( !sock.ConnectBlocking( server, port ) ) return; if( !sock.ConnectBlocking( server, port ) ) return;
char request[4096]; char request[4096];
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() ); const auto len = sprintf( request, "GET %s HTTP/1.1\r\nHost: %s\r\nUser-Agent: Tracy Profiler %i.%i.%i (%s) [%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(), tracy::GitRef );
sock.Send( request, len ); sock.Send( request, len );
char response[4096]; char response[4096];
const auto sz = sock.ReadUpTo( response, 4096 ); const auto sz = sock.ReadUpTo( response, 4096 );