1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Remove ugly curl struct pointer from jsonFetchValue signature

This commit is contained in:
sapier 2014-06-19 20:58:22 +02:00
parent 9a39848ba9
commit 8af44f8163
6 changed files with 25 additions and 39 deletions

View file

@ -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) {