summaryrefslogtreecommitdiff
path: root/src/convert_json.cpp
diff options
context:
space:
mode:
authorsapier <Sapier at GMX dot net>2014-06-19 20:58:22 +0200
committersapier <Sapier at GMX dot net>2014-06-19 21:24:53 +0200
commit8af44f81637938db7e4651d2ef8a294cf43b1072 (patch)
tree85a1f6cf48525b08d8570db036977ed04698060f /src/convert_json.cpp
parent9a39848ba93eaa56f7f62921f8de7a19e3ed0713 (diff)
downloadminetest-8af44f81637938db7e4651d2ef8a294cf43b1072.tar.gz
minetest-8af44f81637938db7e4651d2ef8a294cf43b1072.tar.bz2
minetest-8af44f81637938db7e4651d2ef8a294cf43b1072.zip
Remove ugly curl struct pointer from jsonFetchValue signature
Diffstat (limited to 'src/convert_json.cpp')
-rw-r--r--src/convert_json.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/convert_json.cpp b/src/convert_json.cpp
index a6107aa64..e79103a16 100644
--- a/src/convert_json.cpp
+++ b/src/convert_json.cpp
@@ -32,20 +32,16 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "porting.h"
Json::Value fetchJsonValue(const std::string &url,
- struct curl_slist *chunk) {
+ std::vector<std::string> *extra_headers) {
HTTPFetchRequest fetchrequest;
HTTPFetchResult fetchresult;
fetchrequest.url = url;
fetchrequest.caller = HTTPFETCH_SYNC;
-#if USE_CURL
- struct curl_slist* runptr = chunk;
- while(runptr) {
- fetchrequest.extra_headers.push_back(runptr->data);
- runptr = runptr->next;
- }
-#endif
+ if (extra_headers != NULL)
+ fetchrequest.extra_headers = *extra_headers;
+
httpfetch_sync(fetchrequest,fetchresult);
if (!fetchresult.succeeded) {