From 5df8c5140292520bafe92efa94935a776d63d108 Mon Sep 17 00:00:00 2001 From: Alexander Tkachev Date: Tue, 17 May 2016 20:17:41 +0600 Subject: CLOUD: Fix CurlJsonRequest It's using MemoryWriteStreamDynamic instead of String and it prepares raw byte contents of this stream for JSON::parse(). --- backends/networking/curl/curljsonrequest.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'backends/networking/curl/curljsonrequest.h') diff --git a/backends/networking/curl/curljsonrequest.h b/backends/networking/curl/curljsonrequest.h index 73e0144c64..e9634393dc 100644 --- a/backends/networking/curl/curljsonrequest.h +++ b/backends/networking/curl/curljsonrequest.h @@ -24,6 +24,7 @@ #define BACKENDS_NETWORKING_CURL_CURLJSONREQUEST_H #include "backends/cloud/request.h" +#include "common/memstream.h" namespace Networking { @@ -32,7 +33,10 @@ class NetworkReadStream; class CurlJsonRequest : public Cloud::Request { const char *_url; NetworkReadStream *_stream; - Common::String _contents; + Common::MemoryWriteStreamDynamic _contentsStream; + + /** Prepares raw bytes from _contentsStream to be parsed with Common::JSON::parse(). */ + char *getPreparedContents(); public: CurlJsonRequest(Callback cb, const char *url); -- cgit v1.2.3