diff options
author | proller <proler@github.com> | 2013-11-05 16:57:43 +0400 |
---|---|---|
committer | proller <proler@github.com> | 2013-11-06 00:50:32 +0400 |
commit | 8903c68460d79aeac6b1c5074003743f98371339 (patch) | |
tree | f96de4f3e1398b68e3316a9641f31ef0aad996af /src/convert_json.cpp | |
parent | 6f44492238c89079402a984466d037f4558924e6 (diff) | |
download | hax-minetest-server-8903c68460d79aeac6b1c5074003743f98371339.tar.gz hax-minetest-server-8903c68460d79aeac6b1c5074003743f98371339.zip |
Correct useragent in http queries
Net struct init
Diffstat (limited to '')
-rw-r--r-- | src/convert_json.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/convert_json.cpp b/src/convert_json.cpp index edb37024c..e8eede0b1 100644 --- a/src/convert_json.cpp +++ b/src/convert_json.cpp @@ -27,6 +27,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "log.h" #include "main.h" // for g_settings #include "settings.h" +#include "version.h" #if USE_CURL #include <curl/curl.h> @@ -56,6 +57,7 @@ Json::Value fetchJsonValue(const std::string url, curl_easy_setopt(curl, CURLOPT_WRITEDATA, &liststring); curl_easy_setopt(curl, CURLOPT_TIMEOUT_MS, g_settings->getS32("curl_timeout")); curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT_MS, g_settings->getS32("curl_timeout")); + curl_easy_setopt(curl, CURLOPT_USERAGENT, (std::string("Minetest ")+minetest_version_hash).c_str()); if (chunk != 0) curl_easy_setopt(curl, CURLOPT_HTTPHEADER, chunk); |