From a9f73b26be06e341a102fe9360039f9dcdbed8bb Mon Sep 17 00:00:00 2001 From: hikerstk Date: Fri, 4 Mar 2011 04:08:36 +0000 Subject: [PATCH] Added Stephen's patch to include a user agent setting. git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@7809 178a84e3-b1eb-0310-8ba1-8eac791a3b58 --- src/addons/network_http.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/addons/network_http.cpp b/src/addons/network_http.cpp index 954d538b3..741ff387f 100644 --- a/src/addons/network_http.cpp +++ b/src/addons/network_http.cpp @@ -239,6 +239,10 @@ std::string NetworkHttp::downloadToStrInternal(std::string url) std::string full_url = (std::string)UserConfigParams::m_server_addons + "/" + url; curl_easy_setopt(session, CURLOPT_URL, full_url.c_str()); +#ifdef VERSION + std::string uagent = (std::string)"SuperTuxKart/" + VERSION; + curl_easy_setopt(session, CURLOPT_USERAGENT, uagent.c_str()); +#endif std::string fout; @@ -270,6 +274,10 @@ bool NetworkHttp::downloadFileInternal(const std::string &file, std::string full_url = (std::string)UserConfigParams::m_server_addons + "/" + file; curl_easy_setopt(session, CURLOPT_URL, full_url.c_str()); +#ifdef VERSION + std::string uagent = (std::string)"SuperTuxKart/" + VERSION; + curl_easy_setopt(session, CURLOPT_USERAGENT, uagent.c_str()); +#endif FILE * fout = fopen(file_manager->getAddonsFile(save_filename).c_str(), "wb");