summaryrefslogtreecommitdiff
path: root/src/convert_json.cpp
diff options
context:
space:
mode:
authorsapier <Sapier at GMX dot net>2013-07-15 23:36:44 +0200
committerPilzAdam <pilzadam@minetest.net>2013-07-22 18:09:59 +0200
commit5160be91ae6af23cabec5c7412a1c2c45fc46afb (patch)
tree65f349d97f4cbdb67bf007a34578b22617fe28be /src/convert_json.cpp
parentd6c052038fc28db92668821cad5a94683d13d526 (diff)
downloadminetest-5160be91ae6af23cabec5c7412a1c2c45fc46afb.tar.gz
minetest-5160be91ae6af23cabec5c7412a1c2c45fc46afb.tar.bz2
minetest-5160be91ae6af23cabec5c7412a1c2c45fc46afb.zip
Add configurable curl timeout
Diffstat (limited to 'src/convert_json.cpp')
-rw-r--r--src/convert_json.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/convert_json.cpp b/src/convert_json.cpp
index 71cba0695..58eefd901 100644
--- a/src/convert_json.cpp
+++ b/src/convert_json.cpp
@@ -25,6 +25,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "mods.h"
#include "config.h"
#include "log.h"
+#include "main.h" // for g_settings
+#include "settings.h"
#if USE_CURL
#include <curl/curl.h>
@@ -52,7 +54,7 @@ Json::Value fetchJsonValue(const std::string url,
curl_easy_setopt(curl, CURLOPT_URL, url.c_str());
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteCallback);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &liststring);
-
+ curl_easy_setopt(curl, CURLOPT_TIMEOUT_MS, g_settings->getS32("curl_timeout"));
if (chunk != 0)
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, chunk);