summaryrefslogtreecommitdiff
path: root/src/convert_json.cpp
diff options
context:
space:
mode:
authorproller <proler@github.com>2013-11-05 16:57:43 +0400
committerproller <proler@github.com>2013-11-06 00:50:32 +0400
commit8903c68460d79aeac6b1c5074003743f98371339 (patch)
treef96de4f3e1398b68e3316a9641f31ef0aad996af /src/convert_json.cpp
parent6f44492238c89079402a984466d037f4558924e6 (diff)
downloadminetest-8903c68460d79aeac6b1c5074003743f98371339.tar.gz
minetest-8903c68460d79aeac6b1c5074003743f98371339.tar.bz2
minetest-8903c68460d79aeac6b1c5074003743f98371339.zip
Correct useragent in http queries
Net struct init
Diffstat (limited to 'src/convert_json.cpp')
-rw-r--r--src/convert_json.cpp2
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);