diff options
-rw-r--r-- | backends/networking/curl/curljsonrequest.h | 1 | ||||
-rw-r--r-- | backends/networking/curl/postrequest.cpp | 4 | ||||
-rw-r--r-- | backends/networking/curl/postrequest.h | 4 |
3 files changed, 5 insertions, 4 deletions
diff --git a/backends/networking/curl/curljsonrequest.h b/backends/networking/curl/curljsonrequest.h index 11c6bc81ea..e462d5890f 100644 --- a/backends/networking/curl/curljsonrequest.h +++ b/backends/networking/curl/curljsonrequest.h @@ -31,6 +31,7 @@ namespace Networking { typedef Response<Common::JSONValue *> JsonResponse; typedef Common::BaseCallback<JsonResponse> *JsonCallback; +typedef Common::BaseCallback<Common::JSONValue *> *JSONValueCallback; #define CURL_JSON_REQUEST_BUFFER_SIZE 512 * 1024 diff --git a/backends/networking/curl/postrequest.cpp b/backends/networking/curl/postrequest.cpp index 0becc8eef9..1dec36b670 100644 --- a/backends/networking/curl/postrequest.cpp +++ b/backends/networking/curl/postrequest.cpp @@ -28,7 +28,7 @@ namespace Networking { -PostRequest::PostRequest(Common::String url, byte *postData, int postLen, Networking::JsonCallback cb, Networking::ErrorCallback ecb): +PostRequest::PostRequest(Common::String url, byte *postData, int postLen, Networking::JSONValueCallback cb, Networking::ErrorCallback ecb): Networking::Request(nullptr, ecb), _url(url), _jsonCallback(cb), _workingRequest(nullptr), _ignoreCallback(false), _postData(postData), _postLen(postLen) { start(); @@ -87,7 +87,7 @@ void PostRequest::responseCallback(Networking::JsonResponse response) { finishSuccess(); if (_jsonCallback) - (*_jsonCallback)(Networking::JsonResponse(this, json)); + (*_jsonCallback)(json); delete json; } diff --git a/backends/networking/curl/postrequest.h b/backends/networking/curl/postrequest.h index 775af31a3f..568979473c 100644 --- a/backends/networking/curl/postrequest.h +++ b/backends/networking/curl/postrequest.h @@ -30,7 +30,7 @@ namespace Networking { class PostRequest: public Networking::Request { Common::String _url; - Networking::JsonCallback _jsonCallback; + Networking::JSONValueCallback _jsonCallback; Request *_workingRequest; bool _ignoreCallback; Common::String _date; @@ -43,7 +43,7 @@ class PostRequest: public Networking::Request { void errorCallback(Networking::ErrorResponse error); public: - PostRequest(Common::String url, byte *postData, int postLen, Networking::JsonCallback cb, Networking::ErrorCallback ecb); + PostRequest(Common::String url, byte *postData, int postLen, Networking::JSONValueCallback cb, Networking::ErrorCallback ecb); virtual ~PostRequest(); virtual void handle(); |