From 8af44f81637938db7e4651d2ef8a294cf43b1072 Mon Sep 17 00:00:00 2001 From: sapier Date: Thu, 19 Jun 2014 20:58:22 +0200 Subject: Remove ugly curl struct pointer from jsonFetchValue signature --- src/convert_json.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'src/convert_json.cpp') 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 *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) { -- cgit v1.2.3