From 7d12dd6058f0f5faeb35df1fcda8e848d7a632b1 Mon Sep 17 00:00:00 2001 From: kervala Date: Fri, 28 Sep 2012 20:51:53 +0200 Subject: [PATCH] Fixed: #1444 Add details for user-agent --- code/ryzom/client/src/libwww.cpp | 33 +++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/code/ryzom/client/src/libwww.cpp b/code/ryzom/client/src/libwww.cpp index 33e29fab7..4aa31d180 100644 --- a/code/ryzom/client/src/libwww.cpp +++ b/code/ryzom/client/src/libwww.cpp @@ -31,6 +31,10 @@ extern "C" #include "interface_v3/libwww_nel_stream.h" +#ifdef HAVE_REVISION_H +#include "revision.h" +#endif + using namespace NLMISC; /// the cookie value for session identification (nel cookie) @@ -552,8 +556,35 @@ void initLibWWW() /* Initiate libwww */ +#if defined(HAVE_X86_64) + #define RYZOM_ARCH "x64" +#elif defined(HAVE_X86) + #define RYZOM_ARCH "x86" +#elif defined(HAVE_ARM) + #define RYZOM_ARCH "arm" +#else + #define RYZOM_ARCH "unknow" +#endif + +#if defined(NL_OS_WINDOWS) + #define RYZOM_SYSTEM "windows" +#elif defined(NL_OS_MAC) + #define RYZOM_SYSTEM "mac" +#elif defined(NL_OS_UNIX) + #define RYZOM_SYSTEM "unix" +#else + #define RYZOM_SYSTEM "unkown" +#endif + char buffer[256]; + +#ifdef REVISION + sprintf(buffer, "%s.%s-%s-%s", RYZOM_VERSION, REVISION, RYZOM_SYSTEM, RYZOM_ARCH); +#else + sprintf(buffer, "%s-%s-%s", RYZOM_VERSION, RYZOM_SYSTEM, RYZOM_ARCH); +#endif + HTLib_setAppName("Ryzom"); - HTLib_setAppVersion(RYZOM_VERSION); + HTLib_setAppVersion(buffer); /* Set up TCP as transport */ VerifyLibWWW("HTTransport_add", HTTransport_add("buffered_tcp", HT_TP_SINGLE, HTReader_new, HTBufferWriter_new));