User-agent should now specify Linux (or FreeBSD - needs testing, but I'm optimistic)

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@10061 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
stephenjust 2011-10-29 21:49:07 +00:00
parent 03e0906623
commit b262a63d24

View File

@ -497,15 +497,18 @@ CURLcode NetworkHttp::downloadFileInternal(Request *request)
curl_easy_setopt(m_curl_session, CURLOPT_URL, full_url.c_str()); curl_easy_setopt(m_curl_session, CURLOPT_URL, full_url.c_str());
std::string uagent = (std::string)"SuperTuxKart/" + STK_VERSION; std::string uagent = (std::string)"SuperTuxKart/" + STK_VERSION;
// Add platform to user-agent string for informational purposes // Add platform to user-agent string for informational purposes.
// FIXME: Is there a way to identify linux other than just ruling out // Add more cases as necessary.
// windows and mac?
#ifdef WIN32 #ifdef WIN32
uagent += (std::string)" (Windows)"; uagent += (std::string)" (Windows)";
#else #elif defined(__APPLE__)
# ifdef __APPLE__
uagent += (std::string)" (Macintosh)"; uagent += (std::string)" (Macintosh)";
# endif #elif defined(FreeBSD)
uagent += (std::string)" (FreeBSD)";
#elif defined(linux)
uagent += (std::string)" (Linux)";
#else
// Unknown system type
#endif #endif
curl_easy_setopt(m_curl_session, CURLOPT_USERAGENT, uagent.c_str()); curl_easy_setopt(m_curl_session, CURLOPT_USERAGENT, uagent.c_str());
curl_easy_setopt(m_curl_session, CURLOPT_FOLLOWLOCATION, 1); curl_easy_setopt(m_curl_session, CURLOPT_FOLLOWLOCATION, 1);